If statement for time stamp

Seamus2626
Seamus2626 used Ask the Experts™
on
Hi,

I have time stamps on an excel spreadsheet ranging from midday to 4am e.g 12.01 all the way to 03.50

I want an if statement to say = if the time stamp is between 10.00 am and 18.00  pm then it returns day time, and anything else = night

My time stamp looks like = 22/09/2018  00:56:39

Thanks
Seamus
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You can Format->Number->Date and select the one with PM, or Format-->Custom and create one to suit your needs.

Author

Commented:
I can format to AM PM but i need my PM to run from 6pm to 3am and the rest is AM

Thanks
Seamus
Analyst Assistant
Commented:
Perhaps.

=IF(AND(HOUR(A1)>=10, HOUR(A1)<=18), "Daytime", "Nighttime")

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial