Conditional maybe IF question

Z

Zsolt Szabó

Hey, how you doing everybody!
In the F1 cell I have =NOW() with cell format *1:30:55 PM . Is it possible
this cell or a different cell with IF can show (display) me somehow "morning"
, "afternoon" , "evening" etc.
 
B

Bernard Liengme

I am not sure how 'evening' is defined but MOD(F1,1) returns the time as a
fraction of a day.
I chose 6:00 PM as start of evening and used
=IF(MOD(F1,1)<0.5,"Morning",IF(MOD(F1,1)<0.75,"Afternoon","Evening"))
or
=IF(MOD(F1,1)<TIME(12,0,0),"Morning",IF(MOD(F1,1)<TIME(18,0,0),"Afternoon","Evening"))
best wishes
 
G

Gord Dibben

Zsolt

It is possible but..........

Define the time ranges for morning, afternoon and evening.


Gord Dibben MS Excel MVP
 
N

Nick Hodge

Zsolt

Depends when you see evening starting, but this takes <=midday=morning,
<=4:00pm=Afternoon, after 4:00pm = evening

=IF(MOD(NOW(),1)<=0.5,"Morning",IF(MOD(NOW(),1)<=0.6666666,"Afternoon","Evening"))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
www.nickhodge.co.uk
 
Top