Como somar células se contiver parte da string de texto em planilhas Goolge?
Autor: Xiao YangÚltima modificação: 2018-05-22
Para somar os valores das células em uma coluna, se outras células da coluna contiverem uma parte de uma string de texto específica, conforme mostrado a seguir, este artigo apresentará algumas fórmulas úteis para resolver essa tarefa nas planilhas do Google.
Células sumif se contiverem parte de uma string de texto específica em planilhas do Google com fórmulas
As fórmulas a seguir podem ajudá-lo a somar os valores das células se outras células da coluna contiverem uma sequência de texto específica, faça o seguinte:
1. Insira esta fórmula: =sum(filter(B2:B9, regexmatch(A2:A9, "KTE"))) em uma célula em branco e pressione Entrar chave para obter o resultado, consulte a imagem:
Observações:
1. Na fórmula acima: B2: B9 são os valores da célula que você deseja somar, A2: A9 é o intervalo que contém a string de texto específica, “KTE”É o texto específico no qual você deseja somar, altere-o de acordo com sua necessidade.
2. Aqui está outra fórmula que também pode ajudá-lo: =sumif(A2:A9,"*KTE*",B2:B9).
Melhores ferramentas de produtividade de escritório
Aprimore suas habilidades de Excel com o Kutools para Excel e experimente uma eficiência como nunca antes. Kutools para Excel oferece mais de 300 recursos avançados para aumentar a produtividade e economizar tempo. Clique aqui para obter o recurso que você mais precisa...
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)