I'm a Newbie, Need Formula

N

Natalie John

Here are the requirements

I need one answer with different parameters within one formula

If amount is less than or equal to 100 then answer will be Zero
If amount is more than 100 but less than or equal to 150 then answer will be
8% of the amount exceeding 100
If amount is more than 150 but less than or equal to 300 then answer will be
25 + 12% of the amount exceeding 150
If amount is more than 300 but less than or equal to 400 then answer will be
50 + 20% of the amount exceeding 300
If amount is more than 400 but less than or equal to 700 then answer will be
75 + 25% of the amount exceeding 400
If amount is more than 700 then answer will be 100 + 35% of the amount
exceeding 700
 
N

Niek Otten

Several options:

1. You can use my UDF, listed at the end of this post.
In a worksheet, press ALT-F11 to get you to the Visual Basic Editor.
Insert>Module. Paste the code of the UDF into the module.
Press ALT-F11 to return to the worksheet. You can use the function there as if it were a built-in function.
2. Look here:
http://www.mcgimpsey.com/excel/variablerate.html

The UDF:

' ==================================================
Function PercPerSegment(Amount As Double, Table As Range) As Double
' Niek Otten, March 31, 2006

' Progressive pricing
' First argument is the quantity to be priced
' or the amount to be taxed
' Second argument is the Price or Tax% table (vertical)
' Make sure both ends of the table are correct;
' usually you start with zero and the corresponding price or %
' Any value should be found within the limits of the table, so
' if the top slice is infinite, then use
' something like 99999999999999999 as threshold
' and =NA() as corresponding value

Dim StillLeft As Double
Dim AmountThisSlice As Double
Dim SumSoFar As Double
Dim Counter As Long

StillLeft = Amount

For Counter = 1 To Table.Rows.Count - 1
AmountThisSlice = Application.Min(StillLeft, Table(Counter + 1, 1) _
- Table(Counter, 1))
SumSoFar = SumSoFar + AmountThisSlice * Table(Counter, 2)
StillLeft = StillLeft - AmountThisSlice
Next
PercPerSegment = SumSoFar
End Function
' ====================================================


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Here are the requirements
|
| I need one answer with different parameters within one formula
|
| If amount is less than or equal to 100 then answer will be Zero
| If amount is more than 100 but less than or equal to 150 then answer will be
| 8% of the amount exceeding 100
| If amount is more than 150 but less than or equal to 300 then answer will be
| 25 + 12% of the amount exceeding 150
| If amount is more than 300 but less than or equal to 400 then answer will be
| 50 + 20% of the amount exceeding 300
| If amount is more than 400 but less than or equal to 700 then answer will be
| 75 + 25% of the amount exceeding 400
| If amount is more than 700 then answer will be 100 + 35% of the amount
| exceeding 700
 
L

Lars-Åke Aspelin

Here are the requirements

I need one answer with different parameters within one formula

If amount is less than or equal to 100 then answer will be Zero
If amount is more than 100 but less than or equal to 150 then answer will be
8% of the amount exceeding 100
If amount is more than 150 but less than or equal to 300 then answer will be
25 + 12% of the amount exceeding 150
If amount is more than 300 but less than or equal to 400 then answer will be
50 + 20% of the amount exceeding 300
If amount is more than 400 but less than or equal to 700 then answer will be
75 + 25% of the amount exceeding 400
If amount is more than 700 then answer will be 100 + 35% of the amount
exceeding 700

If your amount is in cell A1, try this formula in the cell where you
want you answer

=LOOKUP(A1,{-999,100,150,300,400,700},{0,0,25,50,75,100})+(A1-LOOKUP(G5,{-999,100,150,300,400,700}))*LOOKUP(A1,{-999,100,150,300,400,700},{0,0.08,0.12,0.2,0.25,0.35})

Note: -999 is just a number which is less that the minimum possible
amount. The other numbers all come from you description.

Hope this helps / Lars-Åke
 
W

ward376

=IF(A2<=100,0,IF(A2<=150,(A2-100)*0.08,IF(A2<=150,
(A2-100)*0.08,IF(A2<=300,((A2-150)*0.12)+25,IF(A2<=400,
((A2-300)*0.2)+50,IF(A2<=700,((A2-400)*0.25)+75,IF(A2>700,
((A2-700)*0.35)+A2-700)+100))))))

Cliff Edwards
 
L

Lars-Åke Aspelin

=IF(A2<=100,0,IF(A2<=150,(A2-100)*0.08,IF(A2<=150,
(A2-100)*0.08,IF(A2<=300,((A2-150)*0.12)+25,IF(A2<=400,
((A2-300)*0.2)+50,IF(A2<=700,((A2-400)*0.25)+75,IF(A2>700,
((A2-700)*0.35)+A2-700)+100))))))

Cliff Edwards

I think the end of this formula, when amount is more than 700, does
not match the requirement
"100 + 35% of the amount exceeding 700".
There is one "A2-700" to much there.

Try this instead:

=IF(A2<=100,0,IF(A2<=150,(A2-100)*0.08,IF(A2<=150,
(A2-100)*0.08,IF(A2<=300,((A2-150)*0.12)+25,IF(A2<=400,
((A2-300)*0.2)+50,IF(A2<=700,((A2-400)*0.25)+75,(A2-700)*0.35+100))))))

Hope this helps / Lars-Åke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top