Note: The other languages of the website are Google-translated. Back to English
Log in  \/ 
x
or
x
Inscreva-se  \/ 
x

or

Como VLOOKUP e retornar vários valores correspondentes horizontalmente no Excel?

doc-vlookup-horizontally-1
Por padrão, a função VLOOKUP pode retornar vários valores correspondentes no nível vertical no Excel; em alguns casos, você pode querer retornar vários valores no nível horizontal, como mostrado abaixo na captura de tela. Aqui vou dizer a você uma fórmula pode resolver essa tarefa.
PROCV e retornar vários valores horizontalmente

seta azul bolha direita PROCV e retornar vários valores horizontalmente

Por exemplo, você tem uma gama de dados conforme a captura de tela mostrada abaixo e deseja PROCURAR os preços da Apple.
doc-vlookup-horizontally-2

1. Selecione uma célula e digite esta fórmula =INDEX($B$2:$B$9, SMALL(IF($A$11=$A$2:$A$9, ROW($A$2:$A$9)-ROW($A$2)+1), COLUMN(A1))) nele, e então pressione Shift + Ctrl + Enter e arraste a alça de preenchimento automático para a direita para aplicar esta fórmula até #NUM! parece. Veja a imagem:
doc-vlookup-horizontally-3

2. Em seguida, exclua o #NUM !. Veja a imagem:
doc-vlookup-horizontally-4

Dica: Na fórmula acima, B2: B9 é o intervalo da coluna em que você deseja retornar os valores, A2: A9 é o intervalo da coluna em que o valor de pesquisa está, A11 é o valor de pesquisa, A1 é a primeira célula do seu intervalo de dados , A2 é a primeira célula do intervalo da coluna em que está o valor de pesquisa.

Se quiser retornar vários valores verticalmente, você pode ler este artigo Como pesquisar valor retornar vários valores correspondentes no Excel?


Combine facilmente várias folhas / pasta de trabalho em uma única folha ou pasta de trabalho

Combinar múltiplas planilhas ou pastas de trabalho em uma folha ou pasta de trabalho pode ser complicado no Excel, mas com o Combinar No Kutools para Excel, você pode combinar dezenas de planilhas / pastas de trabalho em uma única planilha ou pasta de trabalho, além disso, você pode consolidar as planilhas em uma com vários cliques apenas.  Clique para um teste gratuito de 30 dias com todos os recursos!
combinar folhas
 
Kutools para Excel: com mais de 300 suplementos úteis do Excel, grátis para testar sem limitação em 30 dias.


As melhores ferramentas de produtividade para escritório

O Kutools for Excel resolve a maioria dos seus problemas e aumenta sua produtividade em 80%

  • armadilha para peixes: Insira rapidamente fórmulas complexas, gráficos e qualquer coisa que você tenha usado antes; Criptografar células com senha; Criar lista de discussão e enviar emails ...
  • Super Formula Bar (edite facilmente várias linhas de texto e fórmula); Layout de leitura (ler e editar facilmente um grande número de células); Colar na faixa filtrada...
  • Mesclar células / linhas / colunas sem perder dados; Dividir o conteúdo das células; Combinar linhas / colunas duplicadas... Evite células duplicadas; Comparar intervalos...
  • Selecione Duplicado ou Único Linhas; Selecione linhas em branco (todas as células estão vazias); Super Find e Fuzzy Find em muitos livros; Seleção aleatória ...
  • Cópia exata Várias células sem alterar a referência da fórmula; Criação automática de referências para várias folhas; Inserir marcadores, Caixas de seleção e mais ...
  • Extrair Texto, Adicionar texto, remover por posição, Remover Espaço; Criar e imprimir subtotais de paginação; Converter entre conteúdo de células e comentários...
  • Super Filtro (salvar e aplicar esquemas de filtro a outras planilhas); Classificação Avançada por mês / semana / dia, frequência e mais; Filtro Especial por negrito, itálico ...
  • Combine pastas de trabalho e planilhas; Mesclar tabelas com base em colunas-chave; Divida os dados em várias folhas; Conversão em lote de xls, xlsx e PDF...
  • Mais de 300 recursos poderosos. Suporta Office / Excel 2007-2019 e 365. Suporta todos os idiomas. Fácil implantação em sua empresa ou organização. Teste gratuito de 30 dias com recursos completos. Garantia de devolução do dinheiro em 60 dias.
guia kte 201905

Guia do Office 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!
officetab bottom
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Tim · 3 months ago
    For anyone experiencing issues in a big data range, ensure you dont have any cells existent with "#N/A" or it will break it. Simple error but can be overlooked.
  • To post as a guest, your comment is unpublished.
    Hexa · 1 years ago
    Hello, I want to use keyword instead of specific text or value here for multiple return values, can you please share code formula for same.
  • To post as a guest, your comment is unpublished.
    MW · 1 years ago
    Hello - This formula worked perfectly - thank you! However, I want to apply it to a long list of lookup values. When I copy and paste the formula it obviously returns the same results as the first lookup value so I removed the $'s from $A$11, but that changes the result to something incorrect. How can I quickly apply this same formula for a long list of lookup values?

    Thank you!

    M
  • To post as a guest, your comment is unpublished.
    pernellefpapapa · 2 years ago
    Bonjour,

    J'ai retransposé mon problème exactement dans les mêmes positions de colonne que l'exemple et j’obtiens le message #VALEUR! dès la première case.

    Mon excel fonctionne en francais, j'ai tout retranscrit en francais, passé ";"au lieu de ",", appuyé sur CTRL+MAJ+Entrée... des idées sur l'origine du problème?

    Fanny
  • To post as a guest, your comment is unpublished.
    Frank · 2 years ago
    what you want to put the price in order of highest qty from column c?
  • To post as a guest, your comment is unpublished.
    gajanan · 2 years ago
    i have to find vertical value first, in vertical value there are more horizontal value and i have choose grater value which i have. which function or formula can help
  • To post as a guest, your comment is unpublished.
    Spark Shit · 4 years ago
    Hi. I have three google spreadsheet. First sheet is named "Summary. It is a table containing the name of our employee and number of evaluation in a week from 1-7. The next sheet is named "Chat Score"and third sheet is named Ëmail Score". What I want to to do is when we input a evaluation score to one of our employee it will be automatically recorded on the "Summary sheet" as evaluation 1 or 2 and so on and so forth. In short I want to get multiple return value in a single seach key across multiple sheet. I hope you can help. https://docs.google.com/spreadsheets/d/1lt-e4MxddUKg5xDt_0YchBiEgGe4mFKB-dHENwwtA6Y/edit?usp=sharing

    https://docs.google.com/spreadsheets/d/1lt-e4MxddUKg5xDt_0YchBiEgGe4mFKB-dHENwwtA6Y/edit?usp=sharing
  • To post as a guest, your comment is unpublished.
    Adam · 4 years ago
    Although I'm looking up my values in another worksheet (I don't think this should cause a problem?), I only seem to have success dragging to the right if I go in and change the +1 to '0' for the 1st instance of the lookup ID, '1' for the 2nd instance and so on. I know how many instances of the lookup ID I have so I can workaround. What do I need to change to allow me to successfully drag the fx across horizontally without needing to edit (i.e getting the #NUM to appear once there are no more lookup values to return).
    • To post as a guest, your comment is unpublished.
      Sunny · 4 years ago
      Sorry, I have not found any solutions about your problems. If you have found that, could you tell me? Thank u.
      • To post as a guest, your comment is unpublished.
        Rankee · 4 years ago
        Change Column to Row at the end of the formula

        "=INDEX($B$1:$B$206, SMALL(IF($A$209=$A$1:$A$206, ROW($A$1:$A$206)-ROW($A$1)+1), ROW(A1)))"
  • To post as a guest, your comment is unpublished.
    Abinaya · 4 years ago
    How to List all values(like list of groceries bought) caused by a specific value (by a person X) using VLOOK_UP and other possible formulas
    • To post as a guest, your comment is unpublished.
      Sunny · 4 years ago
      You mean that to list all grocerise a person need to buy, right? If so, you can refer to the formula in this article, and change the arguments as you need as below screenshot shown.
  • To post as a guest, your comment is unpublished.
    Dani · 4 years ago
    Hello, i type the formula and excel gives an error that says that the formula does not have enough arguments, any help?
  • To post as a guest, your comment is unpublished.
    Rob Jones · 4 years ago
    Just a quick note to all, if you change it to be:

    =IFERROR(INDEX($B$2:$B$9, SMALL(IF($A$11=$A$2:$A$9, ROW($A$2:$A$9)-ROW($A$2)+1), COLUMN(A1))),"None")

    The #NUM will become none or use "" to get a blank cell! Looks much tidier!
  • To post as a guest, your comment is unpublished.
    Richard G · 6 years ago
    I have a similar problem but different.

    Vlookup Multiple Values - Return MULTIPLE corresponding values for MULTIPLE Lookup Values

    The formula I have searches for words in a text strings, starting with A1, then adds categories from a large list of categories in a table on ANOTHER WORKSHEET 'Dynamic Categories Lists' , depending on the words found in the A1 string. This is formula is in B1. The amount of data is huge 19,000 text strings in row A.


    For examples the text string might say:
    A B C
    1 dog has black spots Dalmation
    2 dog is tall Large Dog

    My formula searches for "black spots" and returns " Dalmatians " to B1
    My formula searches for " dog is tall" - my formula searches " tall " and return " large dogs" to B2

    Formula in B1 is:
    =PROPER(IFERROR(LOOKUP(1E+100,SEARCH('Dynamic Categories Lists'!$A$1:$A$1000,A1),'Dynamic Categories Lists'!$A$1:$A$1000),""))

    'Dynamic Categories Lists' (DIFFERENT WORKSHEET)
    A B
    1 Search Word to Find Categories: List Paste
    2 black spots Dalmation
    3 tall Large Dog
    4 short Small Dog
    5 -1000 MORE -1000 MORE


    My problem is I need to find the 2nd, 3rd, 4th occurrences

    Example
    A B C D
    1 dog has black spots Dalmation
    2 dog is tall Large Dog
    3
    4 dog has black spots and is tal Dalmation Large Dog


    A4 "dog has black spots and is tall" I want the formula to return "Dalmation" & "large dog" to B3

    Any help would be appreciated. I have searched heaps of threads and haven’t been able to find the answer!
  • To post as a guest, your comment is unpublished.
    Richard G · 6 years ago
    Thanks for your tips on

    I have a similar problem but different.

    Vlookup Multiple Values - Return MULTIPLE corresponding values for MULTIPLE Lookup Values

    The formula I have searches for words in a text strings, starting with A1, then adds categories from a large list of categories in a table on ANOTHER WORKSHEET 'Dynamic Categories Lists' , depending on the words found in the A1 string. This is formula is in B1. The amount of data is huge 19,000 text strings in row A.


    For examples the text string might say:
    A B C
    1 dog has black spots Dalmation
    2 dog is tall Large Dog

    My formula searches for "black spots" and returns " Dalmatians " to B1
    My formula searches for " dog is tall" - my formula searches " tall " and return " large dogs" to B2

    Formula in B1 is:
    =PROPER(IFERROR(LOOKUP(1E+100,SEARCH('Dynamic Categories Lists'!$A$1:$A$1000,A1),'Dynamic Categories Lists'!$A$1:$A$1000),""))

    'Dynamic Categories Lists' (DIFFERENT WORKSHEET)
    A B
    1 Search Word to Find Categories: List Paste
    2 black spots Dalmation
    3 tall Large Dog
    4 short Small Dog
    5 -1000 MORE -1000 MORE


    My problem is I need to find the 2nd, 3rd, 4th occurrences

    Example
    A B C D
    1 dog has black spots Dalmation
    2 dog is tall Large Dog
    3
    4 dog has black spots and is tal Dalmation Large Dog


    A4 "dog has black spots and is tall" I want the formula to return "Dalmation" & "large dog" to B3

    Any help would be appreciated. I have searched heaps of threads and haven’t been able to find the answer!
  • To post as a guest, your comment is unpublished.
    Summer · 6 years ago
    I have a spreadsheet with 115 client names in it that I pull values on each day from one tab to another using a vlookup. Another person in the office updates the values each day by pasting new values along with the corresponding client names. Client names are pasted on the 'PVAL' tab in column A and client values are pasted in column B. On the tab named Master we run a vlookup for the client names starting in cell N6 (the matching client name is listed in cell AB6). The vlookup is =VLOOKUP(AB6,PortDescPortVal,2,FALSE) Every day we update the spreadsheet there are the same 10 client names that will not automatically update. I have to go to the PVAL tab everyday and retype the client names for those 10 and then the data will update. It works for the rest of the clients every day. Also note that the person who updates the data has tried retyping their names for me but for some reason when she retypes their names the lookup still won't work. I can't find a setting in her Excel that differs from mine. I have ensured that all of the client names are in the array. I cannot for the life of me figure out what the problem is here and why I have to retype 10 out of 115 client names each and every day for the lookup to work. HELP!
    • To post as a guest, your comment is unpublished.
      guest · 3 years ago
      Try add columns (change to your ss range and get rid of the False argument like this; =VLOOKUP(AB6,'PortDescPortVal'!A:AA,2,)

      Maybe Refresh All in Data tab