开发者

How to match 2 columns in excel?

开发者 https://www.devze.com 2023-02-01 01:53 出处:网络
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

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, t开发者_开发技巧hose values should be copied onto a new column.


=VLOOKUP(Sheet1!L24,E24:F27,2)


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消