use the current time to return a value

J

JE McGimpsey

One way:

G1: =IF(OR(MOD(NOW(),1)<7/24,MOD(NOW(),1)>=23/24), 3,
IF(MOD(NOW(),1)>=15/24, 2, 1))
 
S

sjd371

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?
 
D

Dave Peterson

I think you want something like:

=IF(MOD(NOW(),1)<TIME(7,0,0),3,
IF(MOD(NOW(),1)<TIME(15,0,0),1,
IF(MOD(NOW(),1)<TIME(23,0,0),2,1)))

All one cell--G$1
 
J

JE McGimpsey

Yep - I didn't notice I'd failed to reset until after I'd posted a
couple more...<sigh>.
 
Top