Search code examples
arraysgoogle-sheetsgoogle-sheets-formulaarray-formulasgs-vlookup

Google Sheet how to extract a column matching with another column?


I got for exemple my column number 1 and 2 on a sheet, column 1 is names and column 2 is their id's, I would like to extract that column 1 and 2 to another sheet (On the same global sheet just another sheet page inside it) with the same data matching, for exemple I got my column 1 already extracted with

=unique('Data1'!D2:$D)

Which just gives me the whole column, now I would like to extract my column 2 matching with the column 1, for exemple :

In line 18 for column 1 in the original sheet I got name : James In line 18 for column 2 in the original sheet I got ID : 18

On my second sheet where i'm extracting data I got for exemple :

In line 7 for column 1 in the second sheet I got name : James

I would like to do so in column 2 in the second sheete I get the ID matching to the column 1 with the name.

I hope it's a clear question and hope someone can help me with it !


Solution

  • try simple VLOOKUP:

    =ARRAYFORMULA(IFNA(VLOOKUP(D1:D, A:B, 2, 0)))