Share via

COUNTIF after midnight

Anonymous
2023-04-01T13:44:28+00:00


I have a time where I want to count amount of instances (21:00 - 03:20 that something accoured in between times 23:20 - 01:10)
I used formula =COUNTIFS($P$3:$P$22,">="&Q2,$P$3:$P$22,"<"&R2) to bring me the value of it and it works fine till midnight and the formula gave up on working. Any idea what that would be and how can I get it fixed ?

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2023-04-01T15:26:45+00:00

    Could you link to a workbook with thisin it, failing that, could you change the format of all the cells showing times to General and give us a screenshot?

    This is to establish what numbers are behind the time-formatted values.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-04-01T14:31:35+00:00

    =IF(R2<Q2,COUNTIFS($P$3:$P$22,">="&Q2,$P$3:$P$22,"<"&1)+COUNTIFS($P$3:$P$22,">="&0,$P$3:$P$22,"<"&R2),COUNTIFS($P$3:$P$22,">="&Q2,$P$3:$P$22,"<"&R2))

    Was this answer helpful?

    0 comments No comments
  3. HansV 462.6K Reputation points
    2023-04-01T14:19:47+00:00

    How did you fill the times in Q2:BC2 (or further)?

    Was this answer helpful?

    0 comments No comments