Copy link to clipboard
Copied
I want to write a formula that calculates the percent of personal miles drive from total miles driven. Example: Form entries
Total miles driven = 100
Personal miles driven = 37
Percent = 37%
Copy link to clipboard
Copied
Is this a form that has to do with IRS reporting for mileage deduction?
Also, your formula may be completely wrong as there is a lot of explanation that you haven't provided yet for this to work properly.
For example, when you calculate the distance traveled, the speed and the time that it took to get from point A to point B are also involved in the equation.
That said, miles are broken down to Kilometers, and Kilometers to meters, and meters to feet. While time is broken down in hours, minutes, seconds, miliseconds.
This complicates everything as the real formula to calculate this would be :Distance = Rate x Time .Then you'll need to calculate the percentage based on this result.
The other thing that you have messed up in that example is the percentage calculation.
Are we talking about the average or Percentage Change? Because if you're averageing a percentage that is not how it's done.
On the other hand, when it comes to percentage change you also have to deal with two different formulasto reflect if there was a percentage increase or a percentage decrease.
In which case, if your total percentage is captured with a negative value you'll need to establish a condition in JavaScript that can handle which case to apply: a formula to handle percentage increase or a formula to handle if there is a percentage decrease.
Please elaborate a bit more on what you're trying to accomplish so that the developers in the Acrobat community can assist you better.