# Retreiving Data when comparing against multiples

#### smk511

##### New Member
I have an excel document where I am trying to compare a few lists.

In one tab I have a list of customers who qualify for a discount. Most customers qualify for lots of different discounts so the customer ID is in the document multiple times.

In another tab I have a list of Orders from customers. Again, customers order multiple times so the customerID again appears multiple times.

At a baseline I am trying to say in the Orders tab...if a customerID on a specific row appears in the Discounts tab then return the discount they got on that order.

There are other criteria I need to check before looking to see if the customerID is in both tabs, so this will be a multiple condition formula, but the part of the formula that keeps breaking it is checking the CustomerID and I think it is because in the Discount tab the formula is struggling with the multiple entries of the customerID.

I have tried this with pretty much every formula combination I can think of…(if(and), sumifs, sumproduct, index(match(if)) and I keep running into road blocks.
Any ideas/thoughts would be much appreciated.

The formula I am most recently trying is:

=IFERROR(INDEX(\$N\$2:\$N\$16,MATCH(1,IF(\$S2=0,IF('Special Discounts'!\$A\$2:\$A\$24='Sql Data'!\$D2,1)),0)),0)

Where N contains the discount they were given, 'Special Discounts' A contains the customerIDs that qualify for the discount and 'SQL Data'D contains the customer who placed the order.

And I can't for the life of me figure out how to add my sample data...so help with that would also be appreciated. I am in Excel 2010
x
Thanks in advance for any support!

Shante

### Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Replies
5
Views
2K
Replies
1
Views
590
Replies
7
Views
2K
Replies
3
Views
438
Replies
8
Views
841

1,195,664
Messages
6,011,023
Members
441,579
Latest member
satishrazdhan

### 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.

### Which adblocker are you using?

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

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