Hi, Ecel Dumbo!
Give a look at this file:
https://dl.dropboxusercontent.com/u/60558749/LookUP%20formula%20matching%20multiple%20conditions%20-%20Rebates%20Query%20version%202%20%28for%20Ecel%20Dumbo%20at%20chandoo.org%29.xlsx
You've to do a few things:
a) order data in worksheet "Look UP" by Company, Product Number and Units sold, all ascending
b) place an entry with Units Sold = 0 and Discount = 0% for each combination of Company & Product number, as the MATCH function with the "Less than" parameter (1), needs a base value
c) in worksheets Result place this array formula in D2 and copy down thru D11:
=INDICE('Look UP'!A$2:E$16;COINCIDIR(A2&"_"&B2&"_"&TEXTO(SUMAR.SI.CONJUNTO(C$2:C2;A$2:A2;A2;B$2:B2;B2);"000000000");'Look UP'!A$2:A$16&"_"&'Look UP'!C$2:C$16&"_"&TEXTO('Look UP'!D$2:D$16;"000000000");1);5) -----> in english: =INDEX('Look UP'!A$2:E$16,MATCH(A2&"_"&B2&"_"&TEXT(SUMIFS(C$2:C2,A$2:A2,A2,B$2:B2,B2),"000000000"),'Look UP'!A$2:A$16&"_"&'Look UP'!C$2:C$16&"_"&TEXT('Look UP'!D$2:D$16,"000000000"),1),5)
Remember that array formulas should be entered with Ctrl-Shift-Enter instead of just Enter.
d) check your own previous results, as many of them differ from those of calculated by formula, but many of them now equals where before they didn't.
If I don't understand wrongly the discount per Company & Product Number is given for the accumulated units from first row thru actual row inclusive. If that's right, then check your values, otherwise elaborate a bit more and post again the updated workbook.
Regards!