KuraiChikara
Board Regular
- Joined
- Nov 16, 2016
- Messages
- 111
- Office Version
- 2013
- Platform
- Windows
I have an issue with a COUNTIF formula once a schedule goes to midnight and after.
In column A I have four times; 21:00, 22:00, 23:00 and Midnight.
The first formula only looks at A2-A4; omitting midnight: Count, If A2 through A4 is greater than or equal to 9:00 PM, the result is 3; this is fine.
=COUNTIF(A2:A4,">=21:00")
However, in the sense of working schedules, not a standard day, someone who works 4pm to 1am is considered to work later than someone who works 1pm to 10pm, so from a verbiage standpoint you can say 1am is later than 10pm but Excel doesnt like that.
In the second formula, I'm including midnight cell A5, but it doesnt count midnight because midnight in technical terms is not "Greater" than 9pm; it's earlier and I don't know how to represent that.
=COUNTIF(A2:A5,">=21:00")
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Time[/TD]
[TD]Formula 1[/TD]
[TD]Formula 2[/TD]
[/TR]
[TR]
[TD]21:00[/TD]
[TD]3[/TD]
[TD]3 (my goal is 4)[/TD]
[/TR]
[TR]
[TD]22:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]23:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]00:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
In column A I have four times; 21:00, 22:00, 23:00 and Midnight.
The first formula only looks at A2-A4; omitting midnight: Count, If A2 through A4 is greater than or equal to 9:00 PM, the result is 3; this is fine.
=COUNTIF(A2:A4,">=21:00")
However, in the sense of working schedules, not a standard day, someone who works 4pm to 1am is considered to work later than someone who works 1pm to 10pm, so from a verbiage standpoint you can say 1am is later than 10pm but Excel doesnt like that.
In the second formula, I'm including midnight cell A5, but it doesnt count midnight because midnight in technical terms is not "Greater" than 9pm; it's earlier and I don't know how to represent that.
=COUNTIF(A2:A5,">=21:00")
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Time[/TD]
[TD]Formula 1[/TD]
[TD]Formula 2[/TD]
[/TR]
[TR]
[TD]21:00[/TD]
[TD]3[/TD]
[TD]3 (my goal is 4)[/TD]
[/TR]
[TR]
[TD]22:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]23:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]00:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]