Join data from two worksheets in Excel

0

I have two spreadsheets in Excel.

At first I have the following data, for example:

ID   | NOME
-----|----------
100  | Luiz
101  | Pedro
102  | Aline

In the second worksheet, I have:

ID   | CATEGORIA
-----|------------
100  | Livros
100  | Filmes
101  | Livros
101  | Games
101  | Móveis
102  | Filmes

That is, in this second worksheet you have IDs that are repeated for each category. I would like to merge these two spreadsheets, so that it looks more or less like this:

ID   | NOME      | CATEGORIA
-----|-----------|-------------
100  | Luiz      | Livros
100  | Luiz      | Filmes
101  | Pedro     | Livros
101  | Pedro     | Games
101  | Pedro     | Móveis
102  | Aline     | Filmes

Is there such a possibility? Thank you.

    
asked by anonymous 14.02.2017 / 13:50

1 answer

1
  

Is there a possibility?

Yes.

PROCV

In the second worksheet, include the desired column ( NOME ) and procv :

=PROCV(A2;Planilha1.A:B;2;0)

Being:

  • A2 - the cell that contains the ID
  • Planilha1 - the spreadsheet containing the names
  • A:B - selection of column A and B of worksheet Planilha1
  • 2 - column index with the value you want to bring (column NOME )
  • 0 - informs that you want Excel to search for the exact ID

See also

For more information, examples, and explational video, go to Office page .

Note: I tested this command with LibreOffice. With Excel you can have some subtle variation, but the principle is the same.

    
14.02.2017 / 14:10