vlookup

L

Legacy 5232

Guest
I have a set of product names in COLUMN A and another set in COLUMN B. Column A is the old inventory and COLUMN B is the new inventory. What's the formula to do a vlookup (or a lookup, not sure) to compare the two columns. I need to find out what's the difference between the two columns. Like what's new in COLUMN B that's not in COLUMN A and what's old in COLUMN A that's not in COLUMN B.
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

just_jon

Legend
Joined
Sep 3, 2002
Messages
10,473
In column C -

=MATCH(B1,A:A,0)

Will generate #N/A if B1 is not in column A, or return the row number of the 1st match in A if there is one.

Copy down as needed.
 
L

Legacy 5232

Guest
how would i

here's my next question....

How would I setup a macro to compare the data between COLUMN A and COLUMN B. COLUMN A is old inventory, COLUMN B is new inventory.


First function:
What I need ot know is what's in the old inventory (A) that's not in the new inventory (B), and display that product name from COLUMN A into column C with the word DELETE next to it. For example, if Widget1 is in column A but not column B, the output in column c should be Widget1-DELETE.

Second function:
I also need to know what's in the new inventory (B) that's not in the old inventory (A) and output in column D the product name in that cell with the word ADD next to it. Example, if Widget 2 is in COLUMN B but not COLUMN A then the output in COLUMN D should be, Widget2 - ADD.


Any ideas on this one? Thanks :)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,670
Messages
5,597,482
Members
414,144
Latest member
UDFNewbie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top