Excel - How to Compare Cells from 2 Columns then if Column B Matches, Use the Value in Column C next to the Matching Cell in Column B?

眉间皱痕 提交于 2019-12-08 06:05:53

问题


I don't know who else to ask, so if you can help, I'd really appreciate it.

I have 4 columns:

In column A, I have an updated list of 1000 product Sku's ie. A1001 from column C. In column B, its empty. In column C, I have the old list of 1500 sku's In column D, I have a name value that corresponds to the sku in column C. ie. Pita bread

Sample Data:

   A       B      C       D

A10897  ()  A10897  PITA

A15006  ()  A15006  CANDLE

A15008  ()  A15016  TOMATO

A15009  ()  A15017  MILK

A10900  ()  A10900  BREAD

A10901  ()  A10901  WHEAT

So far, I've tried 3 formulas, but its not returning the correct name.

=IF(ISNA(VLOOKUP(E2,$B$2:$B$9999,1,FALSE)),"No",F2)

What excel formula will compare a cell in column A with column C to see if they match, and if they do, show the value of the cell in column D next to column C into cell in column B beside the matched cell in column A.

Like This:

   A       B      C       D

A10897  PITA    A10897  PITA

A15017  MILK    A15006  CANDLE

A10901  WHEAT   A15016  TOMATO

... (NO MATCH)  A15017  MILK

... (NO MATCH)  A10900  BREAD

... (NO MATCH)  A10901  WHEAT

etc...

Please help despair

Thank you.


回答1:


This should work:

  =IFERROR(VLOOKUP(A2,$C$2:$D$9999,2,0),"(NO MATCH)")


来源:https://stackoverflow.com/questions/14328221/excel-how-to-compare-cells-from-2-columns-then-if-column-b-matches-use-the-va

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!