0
votes

I have two excel sheets which I want to compare values of Column A, and fill values of column B from Sheet1 to Sheet2 if match

I want to check if any Value in Sheet1 Column A, matches any Value in Sheet2 Column A. Then copy values of cell on the right of the match (column B) of Sheet1, to Column B, Cell next to the match in Sheet2.

Values in Column A, Sheet1, are unique numbers in random Order. Values in Column A, Sheet2, may match numbers of sheet1, in random Order.

Example

Steet1, Cell A2, has number of product, let's say "nn00" and Cell B2 has the Price of thet product, let's say 100€.

So what I need is, if there is product "nn00" found in Column A, cell A17, of Sheet2, to fill the price in B17, as found in Sheet1

3
Could you show what exactly you have tried so far?Cleb
I tried some functions that I found from Internet, but erased them as they didn't work at all and didn't know how to fix it to work or what changes to do. They were using vlookup in two cases and Index in another case. I should say that I am not familiar with excel at all, except the very everyday basics.Vagelis Skoy

3 Answers

2
votes

You probably want to use a normal

=vlookup(A2;'Sheet2'!A:B;2;0)

?

Edit

I tried to give you an answer that you can copy&paste for your solution (assuming "Sheet2" has the Name "Sheet2"). If you want to know how the function works, you can look here: https://support.office.com/en-in/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1

0
votes

So, to search a value from sheet1, column A, then check if there are any similar values in shteet2 column A, the copy vlaues from Sheet1, Column B, to Sheet2, column B I used =VLOOKUP(A:A;Sheet1!A:B;2;0).

0
votes

Paste the vlookup as mentioned by @niklas-p in Sheet2 column B. It should work the way u want it to. But don't forget to put = so it should be like so:

= vlookup(A2;'Sheet1'!A:B;2;0)

So in other words, vlookup will search for 'A2' which is the product that you want, from 'Sheet1' (the reference sheet to search for that product) using the range 'A:B'and return the value in the same row from the second column (which is the price). The last argument (0 or FALSE) is to return an exact match. So if vlookup can't find the product, then it will return an error, #N/A.

Hope this will clarify.