Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default If then statement and time format

Trying to calculate Overtime using IF THEN. All cells are formatted for time.

If E22 is greater than 40 hours, I want 40, else E22. E22 is 51:00:00 and
the statement keeps comming back with the full 51:00:00.

Excel 2007.

Thanks in advance, I know it is something simple but after 45 minutes, I'm
fed up

Don

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 171
Default If then statement and time format

It would help if you posted the formula you're using, but I'll guess that
you're comparing to the number 40. If you've got everything in time format,
you probably want to compare to 40/24 instead (40 would be 40 days; 40/24
makes it 40 hours).

"DonElston" wrote:

Trying to calculate Overtime using IF THEN. All cells are formatted for time.

If E22 is greater than 40 hours, I want 40, else E22. E22 is 51:00:00 and
the statement keeps comming back with the full 51:00:00.

Excel 2007.

Thanks in advance, I know it is something simple but after 45 minutes, I'm
fed up

Don

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default If then statement and time format

Try:

=IF(E22*2440,40,E22*24)

Formatted as NUMBER

"DonElston" wrote:

Trying to calculate Overtime using IF THEN. All cells are formatted for time.

If E22 is greater than 40 hours, I want 40, else E22. E22 is 51:00:00 and
the statement keeps comming back with the full 51:00:00.

Excel 2007.

Thanks in advance, I know it is something simple but after 45 minutes, I'm
fed up

Don

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default If then statement and time format

Thanks

I still got bizzzre results, BUT rather than using the E22 result, I redid
the cell sums and with the 40/24, got the correct result.

=IF(SUM(H5:H11)40/24,SUM(H5:H11)-40/24,0) Figures OT
=IF(SUM(H6:H12)40/24,40/24,SUM(H6:H12)) Regular

Thanks again



"Toppers" wrote:

Try:

=IF(E22*2440,40,E22*24)

Formatted as NUMBER

"DonElston" wrote:

Trying to calculate Overtime using IF THEN. All cells are formatted for time.

If E22 is greater than 40 hours, I want 40, else E22. E22 is 51:00:00 and
the statement keeps comming back with the full 51:00:00.

Excel 2007.

Thanks in advance, I know it is something simple but after 45 minutes, I'm
fed up

Don

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
if then statement = time jstaggs[_2_] Excel Worksheet Functions 2 May 1st 07 09:12 PM
If statement with time Smudge Excel Discussion (Misc queries) 2 January 31st 07 03:15 PM
IF statement to calculate time usage in specific time bands Daren Excel Worksheet Functions 6 January 31st 07 01:34 PM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM
Remove time from a date and time field? Format removes the displa. oaoboc Excel Worksheet Functions 1 February 16th 05 07:20 PM


All times are GMT +1. The time now is 02:09 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"