Formula to lookup the result in the correct tier according to differnt product

sheyy88

New Member
Joined
May 26, 2017
Messages
4
Hi,

Can someone teach me how to use excel formula to determine the correct number of Free Gift based on the table below?

For example, if a customer purchase 23 units of Product A, he/she will get 5 units of free gift.

Thank you in advance!
Product
Customer Purchase (unit)
Free Gift (unit)
A
>10
2
A
>20
5
A
>25
10
B
>10
1
B
>20
7
B
>30
18
C
>5
2
C
>10
5
C
>25
15
Example:
Product
Customer Purchase (unit)
Free Gift (unit)
A
23
5
B
14
1
C
30
15

<tbody>
</tbody>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi and welcome to MrExcel,

try this:

Excel 2016 (Windows) 64 bit
ABCD
1ProductCustomer Purchase (unit)Free Gift (unit)
2A>102
3A>205
4A>2510
5B>101
6B>207
7B>3018
8C>52
9C>105
10C>2515
11
12Example:
13ProductCustomer Purchase (unit)Free Gift (unit)
14A2355
15B1411
16C301515
Sheet1
Cell Formulas
RangeFormula
D14{=LOOKUP(B14,IF($A$2:$A$10=A14,VALUE(SUBSTITUTE($B$2:$B$10,">","")),""),IF($A$2:$A$10=A14,$C$2:$C$10,0))}
D15{=LOOKUP(B15,IF($A$2:$A$10=A15,VALUE(SUBSTITUTE($B$2:$B$10,">","")),""),IF($A$2:$A$10=A15,$C$2:$C$10,0))}
D16{=LOOKUP(B16,IF($A$2:$A$10=A16,VALUE(SUBSTITUTE($B$2:$B$10,">","")),""),IF($A$2:$A$10=A16,$C$2:$C$10,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,503
Messages
6,125,179
Members
449,212
Latest member
kenmaldonado

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
Back
Top