# Formula Help

##### Well-known Member
Hi Guy's i have this spreadsheet that i need help with. The INPUT cells are F2 and G2.
I need the formula in cell in I2. Would it better to do a macro? for this result?
If Miles 1-400 and G = 1 then 15%
If Miles 1-400 and G = 2 then 8.5%
If miles 401-600 and G = 1 then 20.2%
IF Miles 401-600 and G= 2 then 13%
If Miles 601 > and G = 1 or 2 then 13%
If G = 3 then 0%
BVL Accrual Master.xls
ABCDEFGHI
2\$0.00
3
4IfMiles1-400andG=1then15%
5IfMiles1-400andG=2then8.5%
6Ifmiles401-600andG=1then20.2%
7IFMiles401-600andG=2then13%
8IfMiles601>andG=1or2then13%
9IfG=3then0%
10
Waybill Detail
[/code]

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
try this formula and change the number formating of column I to "percantage":

=IF(AND(F2>=1, F2<=400), IF(G2=1, 15%, IF(G2=2, 8.5%, "")), IF(AND(F2>=401, F2<=600), IF(G2=1, 20.2%, IF(G2=2, 13%, "")), IF(AND(F2>=601, OR(G2=1, G2=2)), 13%, IF(G2=3, 0%, ""))))

If you create a table with the mileages and possible values for G2 and insert the relevant percentages like below.....
Book1
ABCDEFGHIJ
1Miles123
2015%8.50%0%521120.20%
340120.20%13%0%
460113%13%0%
5
Sheet3

Formula in I2

=INDEX(\$B\$2:\$D\$4,MATCH(F2,A\$2:A\$4),MATCH(G2,B\$1:D\$1,0))

try this formula and change the number formating of column I to "percantage":

=IF(AND(F2>=1, F2<=400), IF(G2=1, 15%, IF(G2=2, 8.5%, "")), IF(AND(F2>=401, F2<=600), IF(G2=1, 20.2%, IF(G2=2, 13%, "")), IF(AND(F2>=601, OR(G2=1, G2=2)), 13%, IF(G2=3, 0%, ""))))

This works GREAT... Thank you SO Much

Replies
3
Views
217
Replies
7
Views
318
Replies
7
Views
409
Replies
1
Views
118
Replies
5
Views
241

1,219,792
Messages
6,150,288
Members
450,949
Latest member
faizanmalik10

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

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