LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Far too many "IF"s for my own good

Here's a challenge for anyone who thinks they're good enough. It's
given me an extreme headache. I have two columns of time data (Start
and End). From this I needed to calculate first time difference as a
decimal - done - no problem. Now what I need to do is split that
decimal.

I need to set it up so that the time is split into Basic and Premium
time. If the hours are after 7pm and before 7am they are "premium"
hours - if before "7pm" they are basic. I managed to get it so that it
would come back with the right hours with this formula:

=IF(HOUR($D54)=19,(((HOUR($D54)-19)+(MINUTE($D54)/60))*(E54+F54)),IF(HOUR($D54)<7,(((HOUR($D54)+5)+( MINUTE($D54)/60))*(E54+F54)),0))

Column D being the end time (column C would the the start time). But
this only works if the start time if before 7pm. If both the start and
end time are in the "Premium" time then it doesn't. And then if the
end time is after midnight it works ok (again presuming that start time
is before 7pm) but if the end time IS midnight then I of course get a
huge negative premium time. I managed to get some of the way to fixing
this but only with about 15 "IF"s strung together. There MUST be an
easier way.

PLEASE HELP!!!!!!

I'm only 23 and this has already given me grey hairs.


---
Message posted from http://www.ExcelForum.com/

 
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
I need to display "Good Morning" or "Good Evening" based on NOW() Wesley Excel Worksheet Functions 7 April 24th 23 11:45 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Any good resource to learn Excel Web Query ".iqy" Files? Eric Excel Discussion (Misc queries) 0 March 2nd 08 03:29 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
create links to check boxes marked "good" fair"and "bad" pjb Excel Worksheet Functions 3 April 20th 06 02:17 AM


All times are GMT +1. The time now is 11:21 AM.

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

About Us

"It's about Microsoft Excel"