Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Calculating time in Number Formate

Hi,

I have Created a formula for the users who want to calculate time into
number format.

Example
Anirban want to calculate time spent in Xerox Audit between 7:00 AM to
9:26 AM. Now using simple subtraction formula he will get 1:26 but if
he want to see the result in number formate which shows 1.26, he can
the following formula

=(TRUNC((((B1-A1)*(24*60))/60),0))+((((((B1-A1)*(24*60))/60)-
(TRUNC((((B1-A1)*(24*60))/60),0)))*60)/100)

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Calculating time in Number Formate

Is this solving a problem before it arises?

But what happens if you add add up these *times* in number format?

1:26
1:26
1:26

SUMs to 4:18 but:

1.26
1.26
1.26

SUMs to 3.78 which is not correct.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


wrote in message
ups.com...
Hi,

I have Created a formula for the users who want to calculate time into
number format.

Example
Anirban want to calculate time spent in Xerox Audit between 7:00 AM to
9:26 AM. Now using simple subtraction formula he will get 1:26 but if
he want to see the result in number formate which shows 1.26, he can
the following formula

=(TRUNC((((B1-A1)*(24*60))/60),0))+((((((B1-A1)*(24*60))/60)-
(TRUNC((((B1-A1)*(24*60))/60),0)))*60)/100)




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Calculating time in Number Formate

1. I don't see the point using a decimal value that does not really reflect
the time?
The real decimal value if needed for calculations is

=(B1-A1)*24

formatted as general


2. The difference between 7:00 and 9:26 is not 1:26 it is 2:26



3. You can use a custom format of hh.mm if it is just for display



4. If you really want to get 1.26 you can use a simpler formula like

=HOUR(B1-A1)+MINUTE(B1-A1)/100

or if there can be more than 24 hours

=INT((B1-A1)*24)+MINUTE(B1-A1)/100


all formula results formatted as general


--


Regards,


Peo Sjoblom





wrote in message
ups.com...
Hi,

I have Created a formula for the users who want to calculate time into
number format.

Example
Anirban want to calculate time spent in Xerox Audit between 7:00 AM to
9:26 AM. Now using simple subtraction formula he will get 1:26 but if
he want to see the result in number formate which shows 1.26, he can
the following formula

=(TRUNC((((B1-A1)*(24*60))/60),0))+((((((B1-A1)*(24*60))/60)-
(TRUNC((((B1-A1)*(24*60))/60),0)))*60)/100)



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Calculating time in Number Formate

I have Created a formula for the users who want to calculate time into
number format.

Example
Anirban want to calculate time spent in Xerox Audit between 7:00 AM to
9:26 AM. Now using simple subtraction formula he will get 1:26 but if
he want to see the result in number formate which shows 1.26, he can
the following formula

=(TRUNC((((B1-A1)*(24*60))/60),0))+((((((B1-A1)*(24*60))/60)-
(TRUNC((((B1-A1)*(24*60))/60),0)))*60)/100)


Doesn't this much shorter and easier to remember formula do the same thing?

=--TEXT(B1-A1,"h.mm")

By the way, your posted subtraction was wrong; it should have been 2:26, not
1:26. I have a question, though. Why would you want to show the time as if
it were a floating point number? I mean, 2.26 hours(?) is not the same as
2:26 in hours and minutes, so why would anyone need this particular
conversion?

Rick

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert text number to number formate [email protected] Excel Discussion (Misc queries) 2 April 9th 07 10:48 AM
Calculating Time with a number value Corey Excel Worksheet Functions 2 December 28th 06 05:29 AM
calculating timesheet, time-in/time-out = total hours & minutes, . Steve Lindsay Excel Worksheet Functions 13 November 8th 06 03:45 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM
Calculating effective time from start/end date+time Stefan Stridh Excel Worksheet Functions 8 November 27th 04 03:50 PM


All times are GMT +1. The time now is 06:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"