Ir para o conteúdo principal

Como encontrar valor em uma célula com lista separada por vírgulas no Excel?

Supondo que você tenha uma coluna que contém valores separados por vírgula, como Vendas, 123, AAA, e agora você deseja descobrir se o valor 123 na célula separada por vírgula, como pode fazer? Este artigo irá apresentar o método para resolver o problema.

Encontre o valor em uma célula com lista separada por vírgulas com fórmula


Encontre o valor em uma célula com lista separada por vírgulas com fórmula

A fórmula a seguir pode ajudá-lo a encontrar o valor em uma célula com lista separada por vírgulas no Excel. Faça o seguinte.

1. Selecione uma célula em branco, insira a fórmula =IF(ISNUMBER(SEARCH(123,A2)),"yes","no") na barra de fórmulas e pressione a tecla Enter. Veja a imagem:

Note: na fórmula, A2 é a célula que contém os valores separados por vírgulas que você encontrará.

2. Continue selecionando a célula de resultado e arraste o indicador de preenchimento para baixo para obter todos os resultados. Se o valor “123” estiver nas células separadas por vírgula, você obterá o resultado como “Sim”; caso contrário, você obterá o resultado como “Não”. Veja a imagem:


Artigos relacionados:

Melhores ferramentas de produtividade de escritório

🤖 Assistente de IA do Kutools: Revolucionar a análise de dados com base em: Execução Inteligente   |  Gerar Código  |  Crie fórmulas personalizadas  |  Analise dados e gere gráficos  |  Invocar funções do Kutools...
Recursos mais comuns: Encontre, destaque ou identifique duplicatas   |  Excluir linhas em branco   |  Combine colunas ou células sem perder dados   |   Rodada sem Fórmula ...
Super pesquisa: VLookup de múltiplos critérios    VLookup de múltiplos valores  |   VLookup em várias planilhas   |   Pesquisa Difusa ....
Lista suspensa avançada: Crie rapidamente uma lista suspensa   |  Lista suspensa de dependentes   |  Lista suspensa de seleção múltipla ....
Gerenciador de colunas: Adicione um número específico de colunas  |  Mover colunas  |  Alternar status de visibilidade de colunas ocultas  |  Compare intervalos e colunas ...
Recursos em destaque: Foco da Grade   |  Vista de Design   |   Grande Barra de Fórmula    Gerenciador de pastas de trabalho e planilhas   |  Biblioteca (Auto texto)   |  Data Picker   |  Combinar planilhas   |  Criptografar/Descriptografar Células    Enviar e-mails por lista   |  Super Filtro   |   Filtro Especial (filtro negrito/itálico/tachado...) ...
15 principais conjuntos de ferramentas12 Texto Ferramentas (Adicionar texto, Remover Personagens, ...)   |   50+ de cores Tipos (Gráfico de Gantt, ...)   |   Mais de 40 práticos Fórmulas (Calcule a idade com base no aniversário, ...)   |   19 Inclusão Ferramentas (Insira o código QR, Inserir imagem do caminho, ...)   |   12 Conversão Ferramentas (Números para Palavras, Conversão de moedas, ...)   |   7 Unir e dividir Ferramentas (Combinar linhas avançadas, Dividir células, ...)   |   ... e mais

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...

Descrição


Office Tab traz interface com guias para o Office e torna seu trabalho muito mais fácil

  • Habilite a edição e leitura com guias em Word, Excel, PowerPoint, Publisher, Access, Visio e Project.
  • Abra e crie vários documentos em novas guias da mesma janela, em vez de em novas janelas.
  • Aumenta sua produtividade em 50% e reduz centenas de cliques do mouse para você todos os dias!
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
It’s working for single value, how do I find multiple values. Example: search values (101, 402,110) it might have all 3 or only one or two values and find cell will have any of three or all three or two.
Scenarios
1. Cell 1: 101 cell 2: 101,402,110,202,220
2. Cell 1: 101,402 cell 2: 101,402,202,220,110
3. Cell 1: 110,101,402 cell 2: 101,402,202,220,110

Pls advice
This comment was minimized by the moderator on the site
Hey, I still cant figure this out. I am still having the same problem. instead of using number in the formula I am using a cell reference. for example if i am searching for "1"(Q$1) in (123, 25,29,200)($J2) it is still giving me YES. The formula is =IF(ISNUMBER(SEARCH(Q$1,$J2)),"yes","no")

PS: I have a big data set I cannot put commas before and after in every cell. Will appreciate a solution
This comment was minimized by the moderator on the site
Hi Hassam

Just use the following formula without the IF function. If the number matches exactly, you will get the result "TRUE", otherwise you will get the result "FALSE".
=ISNUMBER(FIND(",1,",","&$J2&","))
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/match.png
This comment was minimized by the moderator on the site
Hi All, I have a cell that has multiple countries separated by commas
Example : A2 cell value is (India, Japan, Malaysia, Greater China)
Column G has the country names
Now , I need to find look for a formula that compares value from column G to value in A2 cell .
If the value matches, then return true otherwise return False
This comment was minimized by the moderator on the site
Hi Mohini Verma,
The formula can be modified as follows:
=IF(ISNUMBER(SEARCH(G2,A2)),"TRUE","FALSE")
This comment was minimized by the moderator on the site
How about this please, I need to get the values in A and equate them with the figures in C and return the values in B separated as in commas respectively to C.

Thanks
This comment was minimized by the moderator on the site
Hi duncan,
If you are using Excel for 365, the following formula can help solving the problem.
=TEXTJOIN(",",TRUE,XLOOKUP(TRANSPOSE(VALUE(TEXTSPLIT(D1,","))),A1:A3,B1:B3,"",0,1))
This formula only works in Excel for 365. For other Excel versions other than Excel for 365, I have not found a formula that handles it..
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/find-value.png
This comment was minimized by the moderator on the site
Hi Please help

I have table in Excel with two columns A & B, under A there are value Eg A2 Cell has 1,2,2,1,2,1,2 etc ( only has two numbers 1 and 2 but needs to recognise it has only 1 & 2 in the whole cell and no other number) and A3 has 1,1,1 and A4 has 0, A5 has 2,2,2,2 and A6 has 20. i want B2 should return the value for A2 as Asia, B3 Africa, B4 as None, B5 as America and B6 as Europe. I thought i could use the if formula but it is not able to recognise comma separated numbers and return value). Please Help
This comment was minimized by the moderator on the site
Hello!
This is a really cool formula, but it has ... flaw? ... that I cannot figure out how to work around it. "Flaw" is not the correct word, but I cannot think (it's 8:30 am on Monday) of the right word.
When you are looking for any part of a number, you get "yes". So, the following all return "yes":
=IF(ISNUMBER(SEARCH(12,A2)),"yes","no")
=IF(ISNUMBER(SEARCH(23,A2)),"yes","no")
=IF(ISNUMBER(SEARCH(3,A2)),"yes","no")

I tried wrapping the numbers in quotes to no avail. The formula works perfectly for the example's use case, in which all of the numbers are of the same length. But if you are looking for a shorter number that happens to appear in the string, you get a false positive.
Is there an alternative to "SEARCH" that is more literal (again, is that the word? haha)? 
Thanks! 
This comment was minimized by the moderator on the site
Hi Scott S.,Do you mean search for the exact string?
This comment was minimized by the moderator on the site
Hi, Crystal.
Yes, I suppose that is the way to phrase it. 
The current solution will return “Yes” for any part of the number string. So the numbers 1, 2, 3, 12, 23, and 123 will all return “Yes”. 
I have been trying to come up with a solution that will search a string of numbers and return “Yes” for an exact match. 
This comment was minimized by the moderator on the site
Hi Scott S,Thanks for your feedback. I haven't found the solution yet and will get back to you if I found it.
This comment was minimized by the moderator on the site
I have found a solution. If you add a comma to the left and right of your list it will require the search function to find an exact match from comma to comma. See example below:
=IF(ISNUMBER(SEARCH(",12,",A2)),"yes","no")

,312,123,10,112,126,
This will return false because there is no variable from comma to comma (,12,) that matches the search. 
If you need further clarification let me know and ill post a better example.I was having the same problem when automating a report for my boss and had an epiphany. :)
This comment was minimized by the moderator on the site
Hey, I still cant figure this out. I am still having the same problem. instead of using number in the formula I am using a cell reference. for example if i am searching for "1"(Q$1) in (123, 25,29,200)($J2) it is still giving me YES. The formula is =IF(ISNUMBER(SEARCH(Q$1,$J2)),"yes","no")

PS: I have a big data set I cannot put commas before and after in every cell. Will appreciate a solution
This comment was minimized by the moderator on the site
I have found a solution for this. If you add a comma to the left and right of your list and include them (like a sandwich) in your search it'll allow you to find an exact match. Example below:
,123,231,321,122,321,1,2,3,23,
SEARCH(",23,")
This way it forces the search to match from one comma to the other rather than just part of the entry from the list. Hope this is what you were looking for?
This comment was minimized by the moderator on the site
Good Morning to all.I have a excel question that how to count comma separated specific values in a single cell in excel.I want to count no of 15's in a single cell that contains 15,215,15,155,45,1515,15 I need the result 3. Is there any formula in excel.
This comment was minimized by the moderator on the site
Yes, there is a function in Excel that can do this for you. However, as explained in the problem above to gain better accuracy for your data add a comma to the left and right of your list and include it in your search. See example below:
,15,215,15,155,45,1515,15,
=COUNTIF(A1, ",15,")
The explanation of this formula is as follows: =COUNTIF(cell number or range, value your looking for/counting)
Let me know if you need a better example.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations