View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default I need to display "Good Morning" or "Good Evening" based on NOW()

"T. Valko" wrote...
Just to be different:


Let's reformat that for clarity,

=IF(NOW()<TIME(12,0,0),
"Good Morning",
IF(NOW()<TIME(18,0,0),
"Good Afternoon",
"Good Evening"
)
)

So where you are it's *always* going to be evening!

....

One of the problems living in a time warp where clocks skip instantly from
noon to 6 PM.

But folling the cause of differentness,

="Good "&LOOKUP(HOUR(NOW()),{0;12;18;22},
{"Morning";"Afternoon";"Evening";"Night"})