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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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