View Single Post
  #3   Report Post  
Niek Otten
 
Posts: n/a
Default

Several options.

One from Chip Pearson:

http://www.cpearson.com/excel/pricing.htm

Another one is to use the User Defined Function below
Go to the VB Editor (ALT+F11)
InsertModule
Paste the funcion in the code window
Use the function from your worksheet
' ===============================
Function PercPerSegment(Amount As Double, Table As Range) As Double
' 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


"clandis" wrote in
message ...

If someone could offer a solution on a percentage formula based on the
table below I would greatly appreciate it:

if the value in cell G6 is $00.01 - $25.00, the percentage is 5.25%
if the value in cell G6 is $25.01 - $1000.00, the percentage is 2.75%
if the value in cell G6 is $1000.01 and greater, the percentage is
1.50%

For example, if I have a value of $1,255.00 in cell G6, I need to
calculate the first $25.00 at 5.25%, $975 at 2.75% and the remainder of
$255.00 at 1.50% added together and output a value in G7.

Doing this manually, i end up with $31.95 in cell G7 ($1.3125 +
$26.8125 + $3.825)

Help


--
clandis
------------------------------------------------------------------------
clandis's Profile:
http://www.excelforum.com/member.php...o&userid=25468
View this thread: http://www.excelforum.com/showthread...hreadid=389079