Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

Can you calculate whether a time is between two other times to show early,
day or late shifts for example?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

=IF(AND(A1=--"00:00",A1<--"08:00"),"Early",IF(AND(A1=--"08:00",A1<--"17:00"),"Day","Late"))

--
__________________________________
HTH

Bob

"Shirley4589" wrote in message
...
Can you calculate whether a time is between two other times to show early,
day or late shifts for example?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

Why did you show 17:00 as the switch over between Day and Late rather than
16:00?

Rick


"Bob Phillips" wrote in message
...
=IF(AND(A1=--"00:00",A1<--"08:00"),"Early",IF(AND(A1=--"08:00",A1<--"17:00"),"Day","Late"))

--
__________________________________
HTH

Bob

"Shirley4589" wrote in message
...
Can you calculate whether a time is between two other times to show
early,
day or late shifts for example?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

Here is another formula for you to consider (note that I used 16:00 for the
switch over between Day and Late)...

If A1 contains a time value only (e.g., 12:34)
**************************************************
=LOOKUP(ROUNDUP(24*A1,9),{0,8,16},{"Early","Day"," Late"})

If A1 contains a full date (e.g., 8/10/2008 12:34)
**************************************************
=LOOKUP(MOD(ROUNDUP(24*A1,9),24),{0,8,16},{"Early" ,"Day","Late"})

Rick


"Shirley4589" wrote in message
...
Can you calculate whether a time is between two other times to show early,
day or late shifts for example?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

The reason I used the ROUNDUP function was to correct the entry at 8:00
which, because its time value is 0.3333... and when multiplied by 24 is ever
so slightly less than 8 which causes it to be incorrectly assigned to Early
rather than Day. Here is a more efficient formula to handle that lone
situation which doesn't incur the extra function call....

If A1 contains a time value only (e.g., 12:34)
**************************************************
=LOOKUP(24*A1+0.01,{0,8,16},{"Early","Day","Late"} )

If A1 contains a full date (e.g., 8/10/2008 12:34)
**************************************************
=LOOKUP(mod(24*A1+0.01,24),{0,8,16},{"Early","Day" ,"Late"})

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Here is another formula for you to consider (note that I used 16:00 for
the switch over between Day and Late)...

If A1 contains a time value only (e.g., 12:34)
**************************************************
=LOOKUP(ROUNDUP(24*A1,9),{0,8,16},{"Early","Day"," Late"})

If A1 contains a full date (e.g., 8/10/2008 12:34)
**************************************************
=LOOKUP(MOD(ROUNDUP(24*A1,9),24),{0,8,16},{"Early" ,"Day","Late"})

Rick


"Shirley4589" wrote in message
...
Can you calculate whether a time is between two other times to show
early,
day or late shifts for example?





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

Shorter version:

=LOOKUP(A1*24,{0,8,16},{"Early","Day","Late"})


"Rick Rothstein (MVP - VB)" wrote:

Here is another formula for you to consider (note that I used 16:00 for the
switch over between Day and Late)...

If A1 contains a time value only (e.g., 12:34)
**************************************************
=LOOKUP(ROUNDUP(24*A1,9),{0,8,16},{"Early","Day"," Late"})

If A1 contains a full date (e.g., 8/10/2008 12:34)
**************************************************
=LOOKUP(MOD(ROUNDUP(24*A1,9),24),{0,8,16},{"Early" ,"Day","Late"})

Rick


"Shirley4589" wrote in message
...
Can you calculate whether a time is between two other times to show early,
day or late shifts for example?



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

That will assign 08:00 to Early rather than Late (see my follow up posting).

Rick


"Teethless mama" wrote in message
...
Shorter version:

=LOOKUP(A1*24,{0,8,16},{"Early","Day","Late"})


"Rick Rothstein (MVP - VB)" wrote:

Here is another formula for you to consider (note that I used 16:00 for
the
switch over between Day and Late)...

If A1 contains a time value only (e.g., 12:34)
**************************************************
=LOOKUP(ROUNDUP(24*A1,9),{0,8,16},{"Early","Day"," Late"})

If A1 contains a full date (e.g., 8/10/2008 12:34)
**************************************************
=LOOKUP(MOD(ROUNDUP(24*A1,9),24),{0,8,16},{"Early" ,"Day","Late"})

Rick


"Shirley4589" wrote in message
...
Can you calculate whether a time is between two other times to show
early,
day or late shifts for example?




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

That will assign 08:00 to Early rather than Late (see my follow up
posting).


That should have said...

"That will assign 08:00 to Early rather than DAY" (emphasis added).

Rick

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00

=LOOKUP(A1*24,{0,8,16},{"Early","Day","Late"})

Works for me.

A1 = 8:00 AM

Formula returns Day.


--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
That will assign 08:00 to Early rather than Late (see my follow up
posting).


That should have said...

"That will assign 08:00 to Early rather than DAY" (emphasis added).

Rick



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 287
Default IS A TIME BETWEEN TWO TIMES EG 12:00 & 8:00



"That will assign 08:00 to Early rather than DAY" (emphasis added).


When I tried it 08:00 was assigned to Day. Although 08:00 = 0.33333 that
doesn't affect Excel's binary-based calculation, surely?

"Rick Rothstein (MVP - VB)" wrote:

That will assign 08:00 to Early rather than Late (see my follow up
posting).


That should have said...

"That will assign 08:00 to Early rather than DAY" (emphasis added).

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
How do you Increment Time by varrying times??? Crackles McFarly Excel Worksheet Functions 7 August 20th 07 03:25 AM
Time difference between two times GL Excel Worksheet Functions 1 March 7th 07 04:43 PM
Countif time is between two nominated times hopeless in excel Excel Worksheet Functions 2 April 20th 06 11:33 PM
How do I add a list of times to get an average time? Matt75 Excel Discussion (Misc queries) 1 January 11th 06 03:07 PM
How do I compare two times to see if one is "late" or "on time"? AuditorGirl Excel Worksheet Functions 1 July 27th 05 05:59 PM


All times are GMT +1. The time now is 01:50 PM.

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"