Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

NB.SI

12 réponses
Avatar
Dominique
bonjour
Pouvez vous m'aider à trouver une formule.
j'ai cette formule qui compte le nombre de cellule, en H3:H131,
superieur à 0.
=NB.SI(Calculateur!H3:H131;">0")
mais je voudrais aussi rajouter un critere :
si la somme de ck:cp est different de 0.
exemple

H CK CL CM CN CO CP
0 1 1 1 0 2 1 ne pas compté
1 0 0 0 0 0 0 ne pas compté
1 1 0 0 1 0 1 compté
2 3 2 2 2 2 2 compté

nombre = 2

,
Merci pour votre aide

10 réponses

1 2
Avatar
PierreB
Le 21/03/2010 14:12, Dominique a écrit :
bonjour
Pouvez vous m'aider à trouver une formule.
j'ai cette formule qui compte le nombre de cellule, en H3:H131,
superieur à 0.
=NB.SI(Calculateur!H3:H131;">0")
mais je voudrais aussi rajouter un critere :
si la somme de ck:cp est different de 0.
exemple

H CK CL CM CN CO CP
0 1 1 1 0 2 1 ne pas compté
1 0 0 0 0 0 0 ne pas compté
1 1 0 0 1 0 1 compté
2 3 2 2 2 2 2 compté

nombre = 2

,
Merci pour votre aide




Bonjour,

Je n'ai pas testé mais il me semble que l'ajout de la fonction ET(
...)doit faire l'affaire:


=NB.SI(ET(Calculateur!H3:H131;">0";SOMME(CK:CP<>0));Calculateur!H3:H131;">0";"")

Pierre
Avatar
Dominique
bonjour
merci pour ton aide mais ca ne marche pas il y a un erreur.
=NB.SI(ET(Calculateur!H3:H131;">0";SOMME(CK:CP)<>0));Calculateur!H3:H131;">0";"")
j essaye avec sommeprod mais idem
Avatar
isabelle
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
bonjour Dominique,<br>
<br>
si tu peut ajouter une colonne "somme"<br>
<br>
<table x:str="" style="border-collapse: collapse; width: 298pt;"
width="399" border="0" cellpadding="0" cellspacing="0">
<col style="width: 32pt;" width="42"> <col style="width: 38pt;"
width="51" span="7"> <tbody>
<tr style="height: 38.25pt;" height="51">
<td class="xl22" style="height: 38.25pt; width: 32pt;" width="42"
align="center" height="51">H&nbsp;&nbsp;&nbsp;</td>
<td class="xl24" style="width: 38pt;" x:str="'somme
CK:CP"
width="51" align="center"><b>somme<br>
CK:CP</b></td>
<td class="xl22" style="width: 38pt;" width="51" align="center">CK</td>
<td class="xl22" style="width: 38pt;" width="51" align="center">CL</td>
<td class="xl22" style="width: 38pt;" width="51" align="center">CM</td>
<td class="xl22" style="width: 38pt;" width="51" align="center">CN</td>
<td class="xl22" style="width: 38pt;" width="51" align="center">CO</td>
<td class="xl22" style="width: 38pt;" width="51" align="center">CP</td>
</tr>
<tr style="height: 12.75pt;" height="17">
<td class="xl22" style="height: 12.75pt;" x:num="" align="center"
height="17">0</td>
<td class="xl23" x:num="" x:fmla="=((SUM(C2:H2))+0)*1"
align="center"><b>6</b></td>
<td class="xl22" x:num="" align="center">1</td>
<td class="xl22" x:num="" align="center">1</td>
<td class="xl22" x:num="" align="center">1</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">2</td>
<td class="xl22" x:num="" align="center">1</td>
</tr>
<tr style="height: 12.75pt;" height="17">
<td class="xl22" style="height: 12.75pt;" x:num="" align="center"
height="17">1</td>
<td class="xl23" x:num="" x:fmla="=((SUM(C3:H3))+0)*1"
align="center"><b>0</b></td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">0</td>
</tr>
<tr style="height: 12.75pt;" height="17">
<td class="xl22" style="height: 12.75pt;" x:num="" align="center"
height="17">1</td>
<td class="xl23" x:num="" x:fmla="=((SUM(C4:H4))+0)*1"
align="center"><b>3</b></td>
<td class="xl22" x:num="" align="center">1</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">1</td>
<td class="xl22" x:num="" align="center">0</td>
<td class="xl22" x:num="" align="center">1</td>
</tr>
<tr style="height: 12.75pt;" height="17">
<td class="xl22" style="height: 12.75pt;" x:num="" align="center"
height="17">2</td>
<td class="xl23" x:num="" x:fmla="=((SUM(C5:H5))+0)*1"
align="center"><b>13</b></td>
<td class="xl22" x:num="" align="center">3</td>
<td class="xl22" x:num="" align="center">2</td>
<td class="xl22" x:num="" align="center">2</td>
<td class="xl22" x:num="" align="center">2</td>
<td class="xl22" x:num="" align="center">2</td>
<td class="xl22" x:num="" align="center">2</td>
</tr>
</tbody>
</table>
<br>
=SOMMEPROD((A3:A131&gt;0)*(B3:B131&gt;0))<br>
<br>
isabelle<br>
<br>
Le 2010-03-21 09:54, Dominique a &eacute;crit&nbsp;:
<blockquote cite="mid:%"
type="cite">bonjour
<br>
merci pour ton aide mais ca ne marche pas il y a un erreur.
<br>
=NB.SI(ET(Calculateur!H3:H131;"&gt;0";SOMME(CK:CP)&lt;&gt;0));Calculateur!H3:H131;"&gt;0";"")
<br>
j essaye avec sommeprod mais idem
<br>
<br>
</blockquote>
</body>
</html>
Avatar
Dominique
Le 21/03/2010 15:25, isabelle a écrit :
merci Isabelle,
mais malheureusement je ne peux pas toucher à la feuille, elle provient
d une extraction par macro.
la fonction NB.Si.ENS ne serait t elle pas plus adapté ? je vais essayer
mais sans conviction.
Avatar
isabelle
peut être avec une fonction perso,

Function MonNBSI(plg As Range, col1 As Integer, col2 As Integer)
For Each c In plg
If c <> 0 And Application.Sum(Range(Cells(c.Row, col1), Cells(c.Row,
col2))) <> 0 Then MonNBSI = MonNBSI + 1
Next
End Function

=MonNBSI(A3:A6;2;7)

isabelle

Le 2010-03-21 10:34, Dominique a écrit :
Le 21/03/2010 15:25, isabelle a écrit :
merci Isabelle,
mais malheureusement je ne peux pas toucher à la feuille, elle
provient d une extraction par macro.
la fonction NB.Si.ENS ne serait t elle pas plus adapté ? je vais
essayer mais sans conviction.



Avatar
Dominique
Le 21/03/2010 15:51, isabelle a écrit :
Merci Isabellle
je vais essayer ta solution. Mais peut tu me donner quelques
explications sur Function, je ne l ai jamais fait.

OU doit je créer ce code ? dans un module normal de mon projet?

Et si je change de PC es ce que la function marchera toujours? Car mon
projet navigue de PC à PC.

es ce que ce module restera lié a ce projet uniquement ou es ce que cela
sera une fonction que je pourrai utiliser dans n importe feuille excel?

merci
Avatar
isabelle
ou bien si tu aime mieux n'avoir que 2 plage à sélectionner pour la
function perso :

Function MonNBSI(plg1 As Range, plg2 As Range)
Dim a As Integer, b As Integer
For Each c In plg1
a = plg2(1).Column
b = plg2(plg2.Count).Column
If c <> 0 And Application.Sum(Range(Cells(c.Row, a), Cells(c.Row, b)))
<> 0 Then MonNBSI = MonNBSI + 1
Next
End Function

=MonNBSI(A3:A131;B3:G131)

isabelle

Le 2010-03-21 10:51, isabelle a écrit :
peut être avec une fonction perso,

Function MonNBSI(plg As Range, col1 As Integer, col2 As Integer)
For Each c In plg
If c <> 0 And Application.Sum(Range(Cells(c.Row, col1), Cells(c.Row,
col2))) <> 0 Then MonNBSI = MonNBSI + 1
Next
End Function

=MonNBSI(A3:A6;2;7)

isabelle

Le 2010-03-21 10:34, Dominique a écrit :
Le 21/03/2010 15:25, isabelle a écrit :
merci Isabelle,
mais malheureusement je ne peux pas toucher à la feuille, elle
provient d une extraction par macro.
la fonction NB.Si.ENS ne serait t elle pas plus adapté ? je vais
essayer mais sans conviction.



Avatar
isabelle
re bonjour Dominique,

oui, copie la function dans un module normal de ton projet, elle sera
toujours disponible même si le fichier se déplace,

et tu peut la voir au menu, Insertion, Fonction,
catégorie : Personnalisées
Function : NomDeTonFichier!MonNBSI

isabelle

Le 2010-03-21 11:05, Dominique a écrit :
Le 21/03/2010 15:51, isabelle a écrit :
Merci Isabellle
je vais essayer ta solution. Mais peut tu me donner quelques
explications sur Function, je ne l ai jamais fait.

OU doit je créer ce code ? dans un module normal de mon projet?

Et si je change de PC es ce que la function marchera toujours? Car mon
projet navigue de PC à PC.

es ce que ce module restera lié a ce projet uniquement ou es ce que
cela sera une fonction que je pourrai utiliser dans n importe feuille
excel?

merci

Avatar
Daniel.C
Bonjour.
=SOMME((H3:H6>0)*(SI((CK3:CK6+CL3:CL6+CM3:CM6+CN3:CN6+CO3:CO6+CP3:CP6)>0;1;0)))
Cordialement.
Daniel

bonjour
Pouvez vous m'aider à trouver une formule.
j'ai cette formule qui compte le nombre de cellule, en H3:H131, superieur à
0.
=NB.SI(Calculateur!H3:H131;">0")
mais je voudrais aussi rajouter un critere :
si la somme de ck:cp est different de 0.
exemple

H CK CL CM CN CO CP
0 1 1 1 0 2 1 ne pas compté
1 0 0 0 0 0 0 ne pas compté
1 1 0 0 1 0 1 compté
2 3 2 2 2 2 2 compté

nombre = 2

,
Merci pour votre aide
Avatar
Sam
Bonjour,
adapte ceci à ton tableau
H en colonne A
CK en colonne B
etc
=SOMMEPROD((A2:A5>0)*(NON((B2:B5=0)*(C2:C5=0)*(D2:D5=0)*(E2:E5=0)*(E2:E5=0)*(G2:G5=0))))
Cordialement
Michel dit "Sam"

"Dominique" a écrit dans le message de news:

Le 21/03/2010 15:25, isabelle a écrit :
merci Isabelle,
mais malheureusement je ne peux pas toucher à la feuille, elle provient d
une extraction par macro.
la fonction NB.Si.ENS ne serait t elle pas plus adapté ? je vais essayer
mais sans conviction.



1 2