Reputation: 207
I have a large array of data, consisting of start and end date/time for license use. I'm trying to count how many users are active at the same time.
I'm using the below formula, but I get a return value of 0 some places, which basically shouldn't be possible.
=CountIFs(E$2:E$5616;"<="&E1108;F$2:F$5616;">"&E1108)
Is the approach wrong or is there a better one?
Edit: Added extra screendump showing the 6 places I have a 0 returned. Have run a clean and trim on the data as well, with no changes to the output.
Edit2: Added npciture showing the difference between my two CountIf and Sumproduct outputs. Is there something I'm missing here, the data should be exactly the same so the output should be 1 and 2 for everything?
Upvotes: 0
Views: 745
Reputation: 34075
Try using SUMPRODUCT
instead of COUNTIFS
, since it isn't susceptible to the same number coercion issues:
=SUMPRODUKT(--(E$2:E$5616<=E2);--(F$2:F$5616>E2))
Upvotes: 1
Reputation: 8230
Try:
=COUNTIFS(E$2:E$5616, "<=" & E1108, F$2:F$5616, ">" & E1108)
Replace ,
with ;
Upvotes: 0