Excel - How to Compare Cells from 2 Columns then i

2019-06-07 02:22发布

问题:

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)")