# Grouping Time into specific Criteria/Group

• Hi there,

I have a file that I would need to group the time into a specific shift. For example,

6.45am to 3.15pm falls under MORNING

3.15pm to 11.45pm falls under EVENING

11.45pm to 6.45am falls under NIGHT

I managed to separate the time from the existing datetime column. However, I'm stuck with the grouping using formulas.

Is it possible to group the time into specific shifts using formulas? Thank you!

## Files

• test.xls

(704 kB, downloaded 12 times, last: )
• ## mrbuttonsOct 21st 2020

Changed the title of the thread from “IF Formula on Time” to “Grouping Time into specific Criteria/Group”.
• You could use:

=IF(OR(B2>=TIME(23,45,0),B2<TIME(6,45,0)),"Night",IF(B2>=TIME(15,15,0),"Evening","Morning"))

Rory
Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

• Glad to help.

Rory
Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why