Create a formula to provide a value depending on when a timestamp falls in the day

numbers

In column A, I have timestamp values. In a second column, I'd like to have a formula that would return words or strings like "early morning" or "Late afternoon", so that I may count and chart these responses. What formula am I looking for in Apple's Numbers?

Best Answer

Assuming you have a normal Numbers Date/Time 2/11/2016 12:00:00 AM, then a simple IF() statement can be used combined with the HOUR function.

=IF( HOUR ( A2 ) < 12, "Good Morning", "Good Afternoon")

To add more than just 2 options, nest your IF statement.

=IF(HOUR(A3) < 5,"Early",IF(HOUR(A3) < 12,"Morning",IF(HOUR(A3) < 17,"afternoon",IF(HOUR(A3) < 20,"evening","night"))))

Numbers will return the first TRUE value.

Formula Sample