Formula Help

Utradeshow

Well-known Member
Joined
Apr 26, 2004
Messages
747
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
1NameLoadDateWaybillCOD=1DOD=2CORP=3D&E=4RatedNetLinehaulMilesSelfHaul=1Booker/OA=2HaulerOnly=3BookingBkg%
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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

iggydarsa

Well-known Member
Joined
Jun 28, 2005
Messages
1,647
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%, ""))))
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
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))
 

Utradeshow

Well-known Member
Joined
Apr 26, 2004
Messages
747
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
 

Watch MrExcel Video

Forum statistics

Threads
1,129,800
Messages
5,638,433
Members
417,025
Latest member
MusterDuster

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
Top