View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default % of difference between two numbers

wrote:
I am looking to show the difference (as a percentage)between
two other numbers that is accurate in increases as well as
decreases. Actually its specifically the percentage CHANGE
between two other numeric values. Perfect example: SALES TAX
if you have 5% sales tax, to spend exactly $100 you have to
buy something for $95 (ie. 1.00 - 5% = .95) simple right?
but if you take $95 and ADD 5% you only get $99.75
so that is what I need, something that works in either case.


As I wrote to "sathish...", if you have a new question, start a new thread.
In fact, your question is unrelated to "% of difference" as it is meant by
the "exeldumb" [sic], the OP.

But in the interest of time, I'll answer your question.

Your algebra is incorrect. If the total must not exceed $100 and 5% is
added to the sales price, the most that you can purchase is 100 = x*(1+5%).
So x = 100/(1+5%) = 95.24.

In Excel: =ROUND(A1/(1+A2),2)

where A1 is the total, and A2 is the percentage added (sales tax) in the
form 5% or 0.05.

Double-check: 95.24 + 95.24*5% = 95.24 + 4.76 = 100.00.

Note: With these numbers, ROUND does work. I would choose ROUNDDOWN to
avoid going over 100 by 1 cent due to rounding. However, I cannot think of
an example quickly that demonstrates the problem. Caveat lector!