Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to Calculate if a Range of Times Falls Between two Date/Time S

I have a problem where I am tracking maintenance workers who forget and do
not clock out for supper. Supper time is between 18:00 and 18:30 hours
daily. I couldnt figure out how formulate if a time range (18:00 - 18:30)
fell between two Date/Time stamps so I compromised figuring if I could
illustrate that his time card showed he was still clocked in during the
middle of the supper mealtime, I would be able to confront him and remind him
of the need to clock out.

Row H is the Start Date/Time

Row I is the Stop Date/Time

Row J contains:
=IF(AND(MOD(H1,1)<TIMEVALUE("18:15"),MOD(I1,1)TIM EVALUE("18:15")),"Worked
During Supper","")


This works most of the time. But when row H is 12/14/2009 16:00 and row I
is 12/15/2009 01:05, I get a blank. I should see €śWorked During Supper€ť.

a. What am I doing wrong?
b. How could I expand the formula to include checking for the full time
range (18:00 - 18:30)?


Thanks,
Michaniker

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default How to Calculate if a Range of Times Falls Between two Date/TimeS

Hi

Try this:

=IF(H2-INT(H2)<=TIMEVALUE("18:00"),IF(OR(I2-INT(I2)=TIMEVALUE
("18:30"),INT(I2)INT(H2)),"Worked During Supper",""),"")

Regards,
Per

On 22 Jan., 01:36, Michaniker
wrote:
I have a problem where I am tracking maintenance workers who forget and do
not clock out for supper. *Supper time is between 18:00 and 18:30 hours
daily. *I couldn’t figure out how formulate if a time range (18:00 - 18:30) *
fell between two Date/Time stamps so I compromised figuring if I could
illustrate that his time card showed he was still clocked in during the
middle of the supper mealtime, I would be able to confront him and remind him
of the need to clock out.

Row H is the Start Date/Time

Row I is the Stop Date/Time * *

Row J contains: *
=IF(AND(MOD(H1,1)<TIMEVALUE("18:15"),MOD(I1,1)TIM EVALUE("18:15")),"Worked
During Supper","")

This works most of the time. *But when row H is 12/14/2009 *16:00 and row I
is 12/15/2009 *01:05, I get a blank. *I should see “Worked During Supper”. *

a. *What am I doing wrong? *
b. *How could I expand the formula to include checking for the full time
range (18:00 - 18:30)?

Thanks,
Michaniker


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
Calculate within a time range with only start date and end date LEG Excel Worksheet Functions 2 October 8th 09 07:25 PM
Need a formula to determine if date falls within a date range then Corca Excel Worksheet Functions 2 September 19th 08 09:36 AM
Calculate how much time falls between set start and stop times Polly Excel Worksheet Functions 17 September 3rd 08 12:12 PM
Need true or false if a date falls between a date range dustin Excel Worksheet Functions 3 December 9th 06 02:01 AM


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