Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

317
Visualizações
Is there any way to use Countif() without overcounting?

Introduction

I'm using an array formula (ctrl+shift+enter) =Sum(countif()) to count in a range how many times some keywords appear. My problem is that if in one cell of that range there is more than one keyword, that cell is counted multiple times (once per keyword) and I don't want that.

Example

I have a table. From A1 to A7 I have text in each cell. Each cell contains colors. It can be one color such as "Red", or many such as "Red, Green, Blue". I want to calculate how many times "Red", "Green" or "Blue" appear in the range. I tried using the formula =Sum(countif(A1:A7;{"*"Red*";"*Green*";"*Blue*"})), but if a cell contains more than one of these colors, the cell is counted multiple times, and that is not the idea.

Question

Which formula should I use? In case there is no function or combination of functions to do this, do you know how to create a macro to create the needed formula? I have created some formulas in macros, but all of them simply combined formulas that already existed in excel so that I didn't need to write all the long formulas each time I want to use them and instead I could simply import my shorter formula.

Notes

  • I use "," for decimal punctuation, that is why I separate arrays and functions with ";".
  • Feel free to change the title to something more appropriate. I'm not sure how to summarize my problem in a question for the title. If you do so, then remove this note.
about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

All Versions:

=SUMPRODUCT(--(MMULT(--ISNUMBER(SEARCH({"Red","Green","Blue"},A1:A6)),ROW($ZZ$1:INDEX($ZZ:$ZZ,COLUMNS({"Red","Green","Blue"})))^0)>0))

Realize that for me {"Red","Green","Blue"} creates a horizontal array. Change the , to the delimiter to make it a horizontal array in your local settings.

And, not sure about this one, but in older version this may require the use of Ctrl-Shift-Enter instead of Enter when exiting edit mode.

enter image description here

about 4 years ago · Santiago Trujillo Relatório

0

You can try below formulas

=SUM(--(MMULT(--(--ISNUMBER(SEARCH({"Red","Green","Blue"},A1:A6))=1),SEQUENCE(3))>0))

In here in the sequence 3 because you have 3 values(Red, Green, Blue) if you have more or less just increase or decrease the sequence

you can also use this one

=COUNT(VALUE(IFERROR(SEARCH({"red"},A1:A6),"")&IFERROR(SEARCH({"blue"},A1:A6),"")&IFERROR(SEARCH({"green"},A1:A6),"")))

Here is the example

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda