Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Can you calculate whether a time is between two other times to show early,
day or late shifts for example? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() "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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you Increment Time by varrying times??? | Excel Worksheet Functions | |||
Time difference between two times | Excel Worksheet Functions | |||
Countif time is between two nominated times | Excel Worksheet Functions | |||
How do I add a list of times to get an average time? | Excel Discussion (Misc queries) | |||
How do I compare two times to see if one is "late" or "on time"? | Excel Worksheet Functions |