Home » excel » How to match 2 columns in excel?

How to match 2 columns in excel?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have an excel sheet, sheet1 which has 2 cols, A and B. Col A has some values and has corresponding mapping in col B(not all values in A have a mapping in B, some are empty). The sorting is done from Z-A and w.r.to Col A. I have another excel sheet, sheet2 which has similar Col A and Col B. Now, i want to find out whether any match is there between Col A of sheet1 and Col A of sheet2. If matches are found, those values should be copied onto a new column.

How to&Answers:
=VLOOKUP(Sheet1!L24,E24:F27,2)

Answer:

I thought I might give a better explanation because i didn’t feel any of these were useful for me to personally figure out VLOOKUP and this answer came up high on list of google when looking for VLOOKUP Examples.

Here is my example which is looking up data from one worksheet to another:

=VLOOKUP(I2,Sheet1!$A$2:$Q$338,2,FALSE)

which is:

=VLOOKUP(<NEEDLE>,<HAYSTACK>,<COLUMN OF HAYSTACK TO PULL BACK INTO LOOKUP COLUMN>,<LEAVE AS FALSE>)

Steps:

  • Select the column which is looked up as the <NEEDLE> eg lookup_value . This might be a list of cars
  • Then select the entire range of the data you want to search within as <HAYSTACK> eg table_array. This is simply a selection of a range of which data to search through. It can be range within the current worksheet, or a range on a different tab/worksheet
  • give a number which is index of column in the Haystack of which column you would like returned as the value. eg col_index_num
  • supply “false” as final paramater. this should always be false at least in the cases I’ve used it.

I hope that helps someone else.

Answer:

It is possible to do a lot with Excel and ADO: Excel VBA to match and line up rows