Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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. InsertModule. 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 he 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 "Natalie John" wrote in message ... | 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Sat, 9 Aug 2008 08:37:27 -0700, Natalie John
wrote: 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.3 5}) 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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=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(A2700, ((A2-700)*0.35)+A2-700)+100)))))) Cliff Edwards |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Sat, 9 Aug 2008 13:16:58 -0700 (PDT), ward376
wrote: =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(A2700, ((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 |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Nuh-uh.
Cliff Edwards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula Problem for Newbie - Please! | New Users to Excel | |||
Real Newbie newbie question | New Users to Excel | |||
formula series (newbie) | Excel Worksheet Functions | |||
Newbie problem need formula help | Excel Worksheet Functions | |||
Newbie needs help deciphering formula. | Excel Worksheet Functions |