Pour additionner les valeurs de cellule dans une colonne si une autre cellule de colonne contient une partie d'une chaîne de texte spécifique comme illustré ci-dessous, cet article présentera une formule utile pour résoudre cette tâche dans les feuilles Google.
Cellules Sumif si contient une partie d'une chaîne de texte spécifique dans des feuilles Google avec des formules
Les formules suivantes peuvent vous aider à additionner les valeurs de cellule si une autre cellule de colonne contient une chaîne de texte spécifique, procédez comme suit:
1. Entrez cette formule: =sum(filter(B2:B9, regexmatch(A2:A9, "KTE"))) dans une cellule vide, puis appuyez sur Entrer clé pour obtenir le résultat, voir capture d'écran:
Notes:
1. Dans la formule ci-dessus: B2: B9 correspond aux valeurs de cellule que vous souhaitez additionner, A2: A9 est la plage contient la chaîne de texte spécifique, "KTE"Est le texte spécifique sur lequel vous souhaitez additionner, veuillez les modifier selon vos besoins.
2. Voici une autre formule qui peut également vous aider: =sumif(A2:A9,"*KTE*",B2:B9).
Améliorez vos compétences Excel avec Kutools for Excel et faites l'expérience d'une efficacité comme jamais auparavant. Kutools for Excel offre plus de 300 fonctionnalités avancées pour augmenter la productivité et gagner du temps. Cliquez ici pour obtenir la fonctionnalité dont vous avez le plus besoin...
This comment was minimized by the moderator on the site
Hello, Thank for super post. I had was able to solve few issues with it. I still have one issue isuse- I am unable to sum up if there is a number in condition column say "=SUMIF(B9:B2414;"85*";E9:E2414)" where B can contains values like "ABC", "851", "865", "LUX",etc.
This comment was minimized by the moderator on the site
Thanks for this. I found both techniques shown work, EXCEPT that the filter and regex method returns an N/A error if there are not matches to the filter. So when I have a number of these formulas in a column and then sum the total, using that method causes the sum to return N/A and therefore the totals to break. However using the sumif and *KTE* method returns a sum of 0 if there are no results, so the summing of totals still works.
This comment was minimized by the moderator on the site
Hello jodamo5,I get your point. Indeed, the filter and regex method returns an #N/A error when there are no matches to filter. Therefore, I recommend the sumif method. Thanks for your notice. Your support means a lot to us. Have a great day.Sincerely,Mandy
This comment was minimized by the moderator on the site
Hello, Adam,To sum the values based on more specifc text, any of the following formulas can do you a favor.=SUMIF(A2:A7, "*KTE*", B2:B7)+SUMIF(A2:A7, "*ABC*", B2:B7) =sum(filter(B2:B7, regexmatch(A2:A7, "KTE")))+sum(filter(B2:B7, regexmatch(A2:A7, "ABC")))
please try, hope it can help you!
This comment was minimized by the moderator on the site
Hi, Sunith,
To replace the specific text with cell reference, please apply the below formula, change the cell C2 to your need.
=sumif(A2:A9,"*"&C2&"*",B2:B9)