View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
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?