Combine Vlookup and If?

V

Vicky

I have 2 lists, in one list I have a customer num, invoice amt, and some
other data (In columns A, B, C, etc). On other sheet I have a second list
which also contains customer num, Invoice amt, other data. This information
is not always the same on both sheets. I need a formula that will find a
customer from sheet 1, look up the customer num on sheet 2, then compare
their Invoice Amounts.

What I did was to create a vlookup to compare the companies, which returned
the invoice amount, in the next column I added an =IF(B2=C2),"same",
different"

Is there an easier way?

Suggestions?
 
J

Jacob Skaria

Hi Vicky

The below formula in Sheet1 will lookup the customer in Sheet1 Row 2 with
the customer in Sheet2 and check whether the amounts are matching

=IF(VLOOKUP(A2,Sheet2!A:B,2,0)=B2,"Amounts are same","DifferentAmounts")

If you want to handle missing customer in Sheet2; try the below enhanced
formula which uses ISNA()

=IF(ISNA(VLOOKUP(A4,Sheet2!A:B,2,0)),"Customer not
found",IF(VLOOKUP(A4,Sheet2!A:B,2,0)=B4,"Amounts are same","Different
Amounts"))

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top