Percentage Calculation

P

Peter Hibbs

I am converting an Excel spreadsheet to an Access database for a
client. The client does some calculations using various columns to
determine the amount due each year. When transalated into VB it comes
out like this :-

Percentage = (AmountDue - AmountPaid) * (100) / AmountDue

where AmountDue and AmountPaid are Currency fields and Percentage is
Single field. At the moment (in the spreadsheet) they enter the
AmountPaid and then calculate the AmountDue by constantly adjusting
the AmountDue until the Percentage value shows the value they want,
say 25% or whatever.

I want to change the Access version so they can just enter the
Percentage value they want and the code calculates the AmountDue
value. Unfortunately my maths skills are pathetic so can anyone give
me the code to do this.

Thanks.

Peter Hibbs.
 
P

Pieter Wijnen

Math lesson #1

Percentage = (AmountDue - AmountPaid) * (100) / AmountDue
<=>
AmountDue*Percentage/100 = (AmountDue - AmountPaid)
<=>
-AmountDue + AmountDue*Percentage/100 = - AmountPaid
<=>
AmountDue - AmountDue*Percentage/100 = AmountPaid
<=>
AmountDue*(1 - 1*Percentage/100) = AmountPaid
<=>
AmountDue = AmountPaid/(1 - Percentage/100)

HtH

Pieter
 
P

Peter Hibbs

Pieter,

Thanks very much, it works a treat. I'll come back to you when I need
lesson #2.

Peter.
 

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