Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate Percentage Reduction? 1

Status
Not open for further replies.

rookery

Programmer
Apr 4, 2002
384
GB
Hi is there a VBA way of calculating a percentage reduction?

eg.

work out what a 20% reduction of 10 is? The answer is 8 of course but is there a way I can code the calculation?

I know I can do it using: 10 x .2 = 2 therefore 10 - 2 = 8 but is there another way?

Ta.
 
Something like this ?
10 * (1 - 20/100)

Replace 10 and 20 with your variables ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
original value * (100 - (% reduction required))/100

so 40% reduction of 20 becomes

20*(100-40)/100

Which is 12

T
 
Thanks guys for your help. Works a treat.

PHV - I think you meant "100" and not "1" in your equation.

Appreciated.

 
PHV - I think you meant "100" and not "1" in your equation
Have you tried it ?
OriginialValue * (1 - PercentageReduction/100)


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top