When you must purchase a liquid by the gallon, it's often helpful to figure out exactly how much each gallon costs. For instance, if you are shopping for large water containers for an office, you may want to calculate the per-gallon price to determine which of the bottles represents the best deal. Figuring out how much a liquid costs per gallon requires the use of a simple mathematical formula.
Write down the total cost of the item. For example, if you purchase a 5-gallon water bottle for $10, the total cost would be $10.
Write down the total number of gallons. In this example, the amount is 5 gallons.
Divide the total price of the item by the total number of gallons. In this example, you would divide $10 by 5 gallons.
Write down the result of your calculations. That number is the price per gallon. Returning to the water bottle example, $10 divided by 5 gallons equals $2 per gallon.
TL;DR (Too Long; Didn't Read)
The same formula works for fractions of a gallon. For example, if the container in this example held 5.25 gallons, the cost would be $10 divided by 5.25, or $1.90 per gallon.