lundi 17 juin 2019

EXCEL - IF Statement for TIME between Ranges

Im using PivotTables and PivotCharts for a Dynamic Dashboard in Excel. Currently i have 3 shifts at work that i'd like to visualize but for that to happen i must:

Extract the time from a "Date & Time Cell" which im doing by using =A2 - INT(A2) . No problem here

Create a nested IF AND formula to check whether the hour fits in any of theses shifts:

15:00 - 23:00 , 23:00 - 7:00 , 7:00 - 15:00

Im using this:

=IF(AND(E2>=TIME(15,0,0),E2<TIME(23,0,0)),"3- 
11",IF(AND(E2>=TIME(23,0,0),E2<TIME(7,0,0)),"11 - 7","7 - 3"))

But it mixes up the shifts, its showing only 3-11 & 7-3 shifts, as if it couldn't distinguish between am and pm... im missing the 23:00 - 7:00 shift

Aucun commentaire:

Enregistrer un commentaire