Forum Discussion
Formule NB.SI.ENS
Je voudrais avoir mes effectifs d'enfants selon des tranches horaires avec la formule NB.SI.ENS mais cela ne calcul pas mes valeurs.
J'ai essayé avec des heures puis avec des chiffres en standard mais rien à faire ça ne fonctionne pas.
Avez vous une idée de comment je peux procéder?
2 Replies
The COUNTIFS (NB.SI.ENS) function returns the number of cells that satisfy ALL conditions simultaneously.
The time cannot be equal to 8 and 8,25 simultaneously, so your formula returns 0.
You can use the following formula in E24:
=NB.SI(E2:E22;"<8,5")
For E25 this would be
=NB.SI.ENS(E2:E22;">=8,5";E2:E22;"<9")
etc.
But this won't work in column G, since G2:G22 does not contain numbers nor time values, but text values that look like times.
You should either enter numbers such as 8,25 and 8,50, or real time values such as 8:15 and 8:30.
If you use the latter, you can use
=NB.SI(G2:G22;"<"&TEMPSVAL("8:30"))
and
=NB.SI.ENS(G2:G22;">="&TEMPSVAL("8:30");G2:G22;"<"&TEMPSVAL("9:00"))
- SergeiBaklanDiamond Contributor
I didn't catch how is your source data is organized. If you use numbers that could be
=SUM(COUNTIFS(E2:E22,{8,8.25}))If texts
=SUM(COUNTIFS(G2:G23,{"8h","8h15"}))Please check formulas in attached file, they will be in your locale.