If you want a numeric result indicating the number of hours, use

=A1*24

 

(where A1 contains the "time")

 

And format as General or as a number / number with decimal places.

 

That will give you 5 instead of 5:00:00 AM, and it will, for example, give
you 5.75 instead of 5:45:00 AM.

 

 

If you only want to know the whole hours, you can use the custom number
format

[h]

 

or

=hour(A1)

 

or

=TRUNC(A1*24)

 

or to round to the nearest number of hours,

=ROUND(A1*24,0)

 

If hours and minutes without AM/PM/seconds,

[h]:mm

 

Asa

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of smitha.kumari
Sent: Thursday, November 10, 2011 10:01 PM
To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ convert data in time to number without any change

 

 

Hours of an employee worked is shown as 5:00:00 AM.

 

I have to convert it into number 5. Please help.

 

Regards

Smitha 

 

-- 
FORUM RULES (934+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (934+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to