Trying to configure if/and then formula based on multiple criteria

Kaz09

New Member
Joined
Jun 1, 2015
Messages
8
Office Version
  1. 2013
Platform
  1. Windows
I am trying to create a formula to determine the result of a lookup table based on two criteria. Eg. If F5 >=90% but less than 100% and C5 >= 70% but less than 101% then multiple F5 by J6 to calculate sum.
Single Book TargetSingle Books SoldPercentage of Sold BoksNo. of Book Sets
Target
No. of Book Sets
old
Percentage Book Set Sales% Volume Bonus Single BooksVolume Bonus Amount Book Sets (70-100%)Volume Bonus Amount Book Sets (101-150%)Volume Bonus Amount Book Sets (150%+)Volume Bonus Payable
77100.00%5059118.00%70%101%150+%
90.00%£300.00£500.00£750.00
100.00%£450.00£800.00£1,050.00
115.00%£550.00£950.00£1,200.00
Examples of what I am trying to calculate
If F5 >=90% but less than 100% and C5 >= 70% but less than 101% then multiple F5 by J6Answer should be: £17,700

Any guidance will be greatly appreciated
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
not sure what columns you have as a table - and did not seem to line up

but using the words

If F5 >=90% but less than 100% and C5 >= 70% but less than 101% then multiple F5 by J6

=IF ( AND ( F5 > = 0.9 , F5 < 1 , C5 > = 0.7 , C5 < 1.01 ) , F5*J6 , "")
Excel Formula:
=IF(AND(F5>0.9,F5<1,C5>0.7,C5<1.01),F5*J6,"")

Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed


I have changed the table into XL2BB

Book2
ABCDEFGHIJKLM
1Single Book TargetSingle Books SoldPercentage of Sold BoksNo. of Book SetsNo. of Book SetsPercentage Book Set Sales% Volume Bonus Single BooksVolume Bonus Amount Book Sets (70-100%)Volume Bonus Amount Book Sets (101-150%)Volume Bonus Amount Book Sets (150%+)Volume Bonus Payable
2Targetold
377100.00%5059118.00%70%101%150+%
490.00%$300.00$500.00$750.00
5100.00%$450.00$800.00$1,050.00
6115.00%$550.00$950.00$1,200.00
7
8Examples of what I am trying to calculate
9
10If F5 >=90% but less than 100% and C5 >= 70% but less than 101% then multiple F5 by J6Answer should be: £17,700
11
12Any guidance will be greatly appreciated 
13 Like Quote Reply
14
Sheet1
Cell Formulas
RangeFormula
I12I12=IF(AND(F5>0.9,F5<1,C5>0.7,C5<1.01),F5*J6,"")
 
Upvote 0
Hi etaf, thank you for coming back. Sorry for not adding this correctly, I tried adding the spreadsheet but didn't work so going to try again.

I don't think I explained what I am trying to do very well so sorry for that.:(

I have been tasked with the following:
Depending on the percentage of book sets (G5) sold & percentage of single books sold (D5) will depend on what commission rate will apply (J6:L8) multiplied by the number of book sets sold (F5)

I tried your formula but couldn't get it to work. Hopefully I have added a mini table using the XL2bb correctly although when I preview it the columns seem really large :unsure: Hopefully I have done this correctly.

I appreciate you taking time out to help solve my issue.

Books Sold.xlsx
ABCDEFGHIJKLM
2
3Single Book TargetSingle Books SoldPercentage of Single Books SoldNo. of Book Sets TargetNo. of Book Sets SoldPercentage of Book Sets Sold % Volume Bonus Single BooksVolume Bonus Amount Book Sets (70-100%)Volume Bonus Amount Book Sets (101-150%)Volume Bonus Amount Book Sets (150%+)Volume Bonus Payable
470%101%150+%
5Quarter 133202090.00%£300.00£500.00£750.00=IF(OR(AND(F5>=90%,F5<100%),AND(C5>=70%,C5<101%)),F5*J6),IF(OR(AND(F5>=100%,F5<115%),AND(C5>=70%,C5<101%)),F5*J7)
6211520100.00%£450.00£800.00£1,050.00
7221519115.00%£550.00£950.00£1,200.00
87685.71%5059118.00%Qtr 1
9Quarter 233202590.00%£300.00£500.00£750.00
10251530100.00%£450.00£800.00£1,050.00
11221523115.00%£550.00£950.00£1,200.00
12710142.86%5078156.00%Qtr 2
13
14
15Examples of what I am trying to calculate
16
17If F5 >=90% but less than 100% and C5 >= 70% but less than 101% then multiple F5 by J6Answer should be: £17,700
18
19If F5 >=90% but less than 100% and C5 >= 101% but less than 150% then multiple F5 by K6Answer should be: £29,500
20
21If F5 >=90% but less than 100% and C5 >= 150% then multiple F5 by L6Answer should be: £44,250
22
23IF F5 >=100% but less than 115% and C5 >= 70% but less than 101% then multiple F5 by J7Answer should be: £26,550
24
25IF F5 >=100% but less than 115% and C5 >= 101% but less than 150% then multiple F5 by K7Answer should be: £47,200
26
Sheet1
Cell Formulas
RangeFormula
E12:F12,B12:C12,E8:F8,B8:C8B8=SUM(B5:B7)
D8,G12,D12,G8D8=C8/B8
 
Upvote 0
column F =
No. of Book Sets Sold

So how is the % worked out ?

If F5 >=90% but less than 100% and C5 >= 70% but less than 101% then multiple F5 by J6
F5 is a number and NOT a percent

column C is Single Books Sold
so C5 is NOT a percent

i think we need more info on how the % is worked out for F5 and C5
 
Upvote 0
Hi etaf, my apologies. I am trying to achieve the bonus paid per quarter based on the below:

The percentage of book sets sold for qtr 1 is 118% (F8 / E8 = G8) and the percentage of single books sold in qtr 1 is 85.71% (C8 / B8 = D8).
Based on the above, I then need to look up cell range I5:L7 to identify the amount payable per book set. The result would be J7 (Percentage of book sets sold 118% - look up row 7) and the percentage of single books sold is 85.71% - look up column J.
I then multiple J7 by the actual number of book sets sold in cell F8 - Bonus payable £550 (J7) x 59 (F8) =

I hope the above is a little clearer.

Thank you again for trying to help.
 
Upvote 0
so we need to do a GRID lookup
to get the value
Q1
=INDEX($J5:$L7,MATCH(G8,$I5:$I7,1),MATCH(D8,$J$4:$L$4,1))
550
F8 = 59
550 * 59 = 32450

Q2
=INDEX($J9:$L11,MATCH(G12,$I9:$I11,1),MATCH(D12,$J$4:$L$4,1))
950
F8 = 78
950*78 = 74100

does that work ?

Merged cells are a pain for formulas - I have added the results in column N and O

try your different values and see if it gives the correct results - if not
let us know

Book5
ABCDEFGHIJKLMNOP
1
2
3Single Book TargetSingle Books SoldPercentage of Single Books SoldNo. of Book Sets TargetNo. of Book Sets SoldPercentage of Book Sets Sold % Volume Bonus Single BooksVolume Bonus Amount Book Sets (70-100%)Volume Bonus Amount Book Sets (101-150%)Volume Bonus Amount Book Sets (150%+)Volume Bonus PayableVolumn Bonus amountVolume Bonus Payable
40.71.01150+%
5Quarter 13320200.9300500750#VALUE!
621152014508001050
72215191.155509501200
87686%5059118%Qtr 155032450
9Quarter 23320250.9300500750
1025153014508001050
112215231.155509501200
12710143%5078156%Qtr 295074100
13
Sheet2
Cell Formulas
RangeFormula
M5M5=IF(OR(AND(F5>=90%,F5<100%),AND(C5>=70%,C5<101%)),F5*J6),IF(OR(AND(F5>=100%,F5<115%),AND(C5>=70%,C5<101%)),F5*J7)
B8:C8,E8:F8,B12:C12,E12:F12B8=SUM(B5:B7)
D8,G8,D12,G12D8=C8/B8
N8,N12N8=INDEX($J5:$L7,MATCH(G8,$I5:$I7,1),MATCH(D8,$J$4:$L$4,1))
O8,O12O8=N8*F8
 
Upvote 0
i had to change and add in zero for the horizontal and vertical lookup - also change the 150%+ to 1.5
otherwise it didnt work for above 150% or below the threshold

We could change - so a N/A error would be a zero - if you dont want the zeros added

Book5
ABCDEFGHIJKLMNOP
1
2
3Single Book TargetSingle Books SoldPercentage of Single Books SoldNo. of Book Sets TargetNo. of Book Sets SoldPercentage of Book Sets Sold % Volume Bonus Single BooksVolume Bonus Amount Book Sets (70-100%)Volume Bonus Amount Book Sets (101-150%)Volume Bonus Amount Book Sets (150%+)Volume Bonus PayableVolumn Bonus amountVolume Bonus Payable
400.71.011.5
500000
6Quarter 13320200.90300500750#VALUE!
7211520104508001050
82215191.1505509501200
976200%505990%Qtr 175044250
1000000
11Quarter 23320250.90300500750
12251530104508001050
132215231.1505509501200
1471035%5078156%Qtr 200
15
Sheet2
Cell Formulas
RangeFormula
N6N6=IF(OR(AND(F6>=90%,F6<100%),AND(C6>=70%,C6<101%)),F6*K7),IF(OR(AND(F6>=100%,F6<115%),AND(C6>=70%,C6<101%)),F6*K8)
B9:C9,E14:F14,B14:C14,E9:F9B9=SUM(B6:B8)
O9,O14O9=INDEX($J5:$M8,MATCH(G9,$I5:$I8,1),MATCH(D9,$J$4:$M$4,1))
P9,P14P9=O9*F9
G14G14=F14/E14


using an IFERROR to give a zero
Book5
ABCDEFGHIJKLMNO
1
2
3Single Book TargetSingle Books SoldPercentage of Single Books SoldNo. of Book Sets TargetNo. of Book Sets SoldPercentage of Book Sets Sold % Volume Bonus Single BooksVolume Bonus Amount Book Sets (70-100%)Volume Bonus Amount Book Sets (101-150%)Volume Bonus Amount Book Sets (150%+)Volume Bonus PayableVolumn Bonus amountVolume Bonus Payable
40.71.011.5
5Quarter 13320200.9300500750#VALUE!
621152014508001050
72215191.155509501200
876200%505990%Qtr 175044250
9Quarter 23320250.9300500750
1025153014508001050
112215231.155509501200
1271035%5078156%Qtr 200
13
Sheet3
Cell Formulas
RangeFormula
M5M5=IF(OR(AND(F5>=90%,F5<100%),AND(C5>=70%,C5<101%)),F5*J6),IF(OR(AND(F5>=100%,F5<115%),AND(C5>=70%,C5<101%)),F5*J7)
B8:C8,E12:F12,B12:C12,E8:F8B8=SUM(B5:B7)
N8,N12N8=IFERROR(INDEX($J5:$L7,MATCH(G8,$I5:$I7,1),MATCH(D8,$J$4:$L$4,1)),0)
O8,O12O8=N8*F8
G12G12=F12/E12
 
Upvote 0
Solution
Hi, etaf,

That is amazing, thank you so much for your very speedy reply. I'm in awe of what you can do. (y) It works a treat and will make my job so much easier. If I wanted to change the 0 to N/A what would I need to change?

Thanks,
Kaz
 
Upvote 0
change
=IFERROR(INDEX($J5:$L7,MATCH(G8,$I5:$I7,1),MATCH(D8,$J$4:$L$4,1)),0)
to
=INDEX($J5:$L7,MATCH(G8,$I5:$I7,1),MATCH(D8,$J$4:$L$4,1))
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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