Excel Tutorial - Example of how to use the VLOOKUP function Excel Tutorial - Exemplo de como usar a VLOOKUP função

Posted on September 5, 2007 at 1:50 pm Postado em 5 de Setembro de 2007, 1:50 hs

Here’s a quick tutorial for those who need help using the VLOOKUP function in Excel. Aqui está um rápido tutorial para aqueles que precisam de ajuda para usar o VLOOKUP função no Excel. VLOOKUP is a very useful function for easily searching through one or more columns in large worksheets to find related data. VLOOKUP é uma função muito útil para pesquisar facilmente através de uma ou mais colunas em grandes folhas para encontrar dados relacionados. You can use HLOOKUP to do the same thing for one or more rows of data. Você pode usar HLOOKUP para fazer a mesma coisa para um ou mais registros de dados. Basically when using VLOOKUP, you’re asking “Here’s a value, find that value in this other set of data, and then return to me the value of another column in that same set of data.” Basicamente, quando usando VLOOKUP, você está pedindo "Aqui está um valor, verificamos que este valor em outro conjunto de dados e, em seguida, trazei - me o valor de uma outra coluna em que o mesmo conjunto de dados".

So you might ask how this can be useful? Então, você pode perguntar como é que este pode ser útil? Well, take for example, the following Pois bem, tomar por exemplo, a seguinte sample spreadsheet Amostra de planilha I have created for this tutorial. Eu criei para este tutorial. The spreadsheet is very simple: one sheet has information on a couple of car owners such as name, id of the car, color and horsepower. A planilha é muito simples: uma folha tem informações sobre um casal de carro proprietários como nome, identificação do veículo, a cor ea potência. The second sheet has the id of the cars and their actual model names. A segunda folha tem o id dos automóveis e seus nomes reais modelo. The common data item between the two sheets is the car id. Os dados ponto comum entre as duas folhas é o carro ID.

Now if I wanted to display the name of the car on sheet 1, I can use VLOOKUP to lookup each value in the car owners sheet, find that value in the second sheet, and then return the second column (the car model) as my desired value. Agora, se eu quisesse exibir o nome do automóvel em folha 1, eu posso usar VLOOKUP a procura cada valor no carro proprietários folha, encontrar esse valor na segunda folha e, em seguida, voltar a segunda coluna (modelo do carro), como o meu Valor desejado. So how do you go about this? Então, como você vai fazer a esse respeito? Well first you’ll need to enter the formula into cell H4 . Well primeiro será preciso digitar a fórmula na célula H4. Notice that I have already entered the full formula into cell F4 through F9 . Aviso que já entrou na íntegra fórmula em células F4 através F9. We’ll walk through what each parameter in that formula actually means. Nós vamos percorrer o que cada parâmetro na fórmula que realmente significa.

Here’s what the formula looks like complete: Veja o que se parece com a fórmula completa:

=VLOOKUP(B4,Sheet2!$A:$B,2,FALSE) = VLOOKUP (B4, Sheet2! $ A: $ B, 2, FALSE)

There are 5 parts to this function: Há 5 partes para esta função:

1. =VLOOKUP - The = denotes that this cell will contain a function and in our case that is the VLOOKUP function to search through one or more columns of data. 1. = VLOOKUP - A = denota que essa célula irá conter uma função e, em nosso caso, que é o VLOOKUP função de pesquisa através de uma ou mais colunas de dados.

2. B4 - The first argument for the function. 2. B4 - O primeiro argumento para a função. This is the actual search term that we want look for. Este é o verdadeiro termo de pesquisa que queremos procurar. The search word or value is whatever is entered into cell B4. A pesquisa palavra ou o valor é o que está inscrita na célula B4.

3. Sheet2!$A:$B - The range of cells on Sheet2 that we want to search through to find our search value in B4. 3. Sheet2! $ A: $ B - O intervalo de células em Sheet2 que queremos através de pesquisa para encontrar nosso pesquisador valor em B4. Since the range resides on Sheet2, we need to precede the range with the name of the sheet followed by an !. Desde o leque reside na Sheet2, precisamos de preceder a faixa com o nome da folha seguido de um!. If the data is on the same sheet, there is no need for the prefix. Se os dados estiverem na mesma folha, não há necessidade de o prefixo. You can also use named ranges here if you like. Você também pode usar intervalos especificados aqui se quiser.

4. 2 - This number specifies the column in the defined range that you want to return the value for. 4. 2 - Este número indica a coluna definida no intervalo que você quiser retornar para o valor. So in our example, on Sheet2, we want to return the value of Column B or the car name, once a match is found in Column A. Note, however, that the column’s position in the Excel worksheet does not matter. Portanto, no nosso exemplo, em Sheet2, queremos devolver o valor da coluna B ou o carro nome, uma vez por correspondência é encontrada na coluna A. Note, contudo, que a posição da coluna na planilha Excel não importa. So if you move the data in Columns A and B to D and E, let’s say, as long as you defined your range in argument 3 as $D:$E , the column number to return would still be 2. Portanto, se você mover os dados nas colunas A e B para D e E, digamos, desde que você definiu o seu leque de argumento 3 como $ D: $ E, a coluna número de voltar ainda seria 2. It’s the relative position rather than the absolute column number. It's a posição relativa e não o número absoluto coluna.

5. False - False means that Excel will only return a value for an exact match. 5. False - False significa que o Excel só retornará um valor para uma correspondência exata. If you set it to True, Excel will look for the closest match. Se você configurá - lo para True, Excel vai olhar para o mais próximo igualar. If it’s set to False and Excel cannot find an exact match, it will return #N/A . Se ele é configurado para False e Excel não podem encontrar uma correspondência exata, ele retornará # N / A.

Hopefully, you can now see how this function can be of use, especially if you have lots of data exported out from a normalized database. Felizmente, agora você pode ver como esta função pode ser de grande utilidade, especialmente se você tiver lotes de dados exportados para fora de uma base normalizada. There may be a main record that has values stored in lookup or reference sheets. Pode haver um registro que tem grandes valores armazenados na procura ou referência folhas. You can pull in other data by “joining” the data using VLOOKUP. Você pode puxar em outros dados por "entrar" os dados usando VLOOKUP.

Another thing you may have noticed is the use of the $ symbol in front of the column letter and row number. Outra coisa que você pode ter notado é o uso do símbolo $ em frente da coluna letra e número fila. The $ symbol tells Excel that when the formula is dragged down to other cells, that the reference should remain the same. O símbolo $ Excel diz que, quando a fórmula é arrastado para baixo para outras células, que a referência deve permanecer o mesmo. For example, if you were to copy the formula in cell F4 to H4, remove the $ symbols and then drag the formula down to H9, you’ll notice that the last 4 values become #N/A. Por exemplo, se você fosse para copiar a fórmula na célula F4 para H4, remova a $ símbolos e, em seguida, arraste a fórmula para baixo a H9, você notará que os 4 últimos valores tornou # N / A.

The reason for this is because when you drag the formula down, the range changes according to the value for that cell. A razão para isso é porque quando você arrastar a fórmula para baixo, o intervalo muda de acordo com o valor para essa célula. So as you can see in the picture above, the lookup range for cell H7 is Sheet2!A5:B8 . Então, como você pode ver na foto acima, a procura gama de células H7 é Sheet2! A5: B8. It simply kept adding 1 to the row numbers. Ela simplesmente mantidos adicionando 1 para o registro números. To keep that range fixed, you need to add the $ symbol before the column letter and row number. Para manter esse intervalo fixo, você precisará adicionar o símbolo $ antes da letra da coluna e linha número.

One note: if you’re going to set the last argument to True, you need to make sure that the data in your lookup range (the second sheet in our example) is sorted in ascending order otherwise it will not work! Uma nota: se você vai definir o último argumento para True, você precisa certificar - se de que os dados da sua procura intervalo (a segunda folha no nosso exemplo), é classificado em ordem crescente, caso contrário não funcionará!

Any questions, post a comment! Qualquer dúvida, posto um comentário!

Technorati Tags: Technorati Tags: , , , , ,

If you enjoyed this post, make sure you Caso você tenha este cargo, certifique - se de subscribe to my RSS feed Inscrever - se em meu feed RSS ! !

» Filed Under »Filed Under MS Office Tips MS Office dicas

Related Posts Related Posts

Please post your comments/suggestions! Please postar seus comentários e sugestões!