I am trying to set up an IF formula that pulls the first two digits of the hour from a date time field (preferably AM/PM). The goal is to say if the date time field starts with 8,9, or 10 then return "8-11 AM" , 11,12,or 1 PM return 11-2 PM.. etc. Any thoughts?
2 respuestas
Hi Rebecca, Try this out:
IF(HOUR(TIMEVALUE(Date_Time__c - 4/24)) < 8, "8 PM - 8 AM",
IF(HOUR(TIMEVALUE(Date_Time__c - 4/24)) < 11, "8 - 11 AM",
IF(HOUR(TIMEVALUE(Date_Time__c - 4/24)) < 14, "11 AM - 2 PM",
IF(HOUR(TIMEVALUE(Date_Time__c - 4/24)) < 20, "2 PM - 8 PM",
null))))
Adjust the text and hour ranges as needed.