Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Simple formula? if the time is =07:00:00<15:00:00, G$1. = 1 if time
=15:00:00 < 23:00:00 G$1 = 2 if Time =23:00:00 < 07:00:00 G$1 = 3 I have tried to do this a few different ways and have been unsuccessful. Could someone help please? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I assume your time is in cell A1 (change to suit). Enter the following
formula in cell G1: = IF( OR(A1 23:00:00, A1 < 07:00:00), 3 ,IF( A1 15:00:00, 2, 1 ) ) (Spaces not really necessary - just easier to read) Pete |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, the first greater than should be greater than or equal to,
i.e. change to = for the comparison with 23:00:00 Pete |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If that doesn't work, try it like this:
= IF( OR(A1 = TIMEVALUE("23:00"), A1 < TIMEVALUE("07:00")), 3,IF( A1 = TIMEVALUE("15:00"), 2, 1 ) ) -- Regards, Tom Ogilvy "Pete" wrote in message oups.com... I assume your time is in cell A1 (change to suit). Enter the following formula in cell G1: = IF( OR(A1 23:00:00, A1 < 07:00:00), 3 ,IF( A1 15:00:00, 2, 1 ) ) (Spaces not really necessary - just easier to read) Pete |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() The other thing that can confuse is that if the cell A1 is formatted a TIME it will display a time even though it has a date. Therefore yo may need to take the fractional part of cell A1 which can be done b substituting TIMEVALUE(A1) for the A! in the previous answer. you can see this in : timevalue(time)=time which is true and timevalue(now)=now which is false hope this help -- tony ----------------------------------------------------------------------- tony h's Profile: http://www.excelforum.com/member.php...fo&userid=2107 View this thread: http://www.excelforum.com/showthread.php?threadid=48874 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
return the current row number for use in a formula | Excel Discussion (Misc queries) | |||
Having the current time inserted w/o updating the current time | Excel Worksheet Functions | |||
use the current time to return a value | Excel Discussion (Misc queries) | |||
Can I automatically enter the current date or current time into a | New Users to Excel | |||
Current time Current date. | Excel Programming |