Formula to calculate the inches given tank size, length, and diameter and gallons per inch

ismailkhowaja

New Member
Joined
Aug 18, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I want to calculate inches for the number of gallons filled in a tank so I need a formula for that.

Tank size = 6000 Gallons
Size = 96 * 192
1 inch can have 16 gallons (I need a formula for that). For example, if my tank contains 1000 gallons, how many inches is that?
 
This should do what you want.
First you need to calculate the volume
View attachment 72050
Then multiple the volume by 0.004329 which is the number of gallons in a cubic inch.
On the web site you referenced note that 16 gallons was 1.298 inches.
If you use the web site and put in 1 inch it returns 10.82 gallons.

In the example below you can just change the height in cell C1. I just added some other heights so you can check against the web site.
Book1
ABCDEFGHIJKLMN
1DiameterLengthHeight
2961921234561012225596
3RadiusGallons
44810.8230.5255.8985.77119.48156.56332.43434.051039.963564.656016.18
Sheet1
Cell Formulas
RangeFormula
A4A4=A2/2
C4,E4:N4C4=$B$2*($A$4^2*(ACOS(($A$4-C$2)/$A$4))-(($A$4-C$2)*SQRT((2*$A$4*C$2)-C$2^2)))*0.004329
I have c4 values already which are gallons inside the tank. I need to know the height at filled level. Its confusing to explain in the words
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you look at Post #24 you'll have all the answers there.
 
Upvote 0
I have created the script that goes to the website, inputs the numbers, and prints the results on the command prompt console. it requires a puppeteer to be installed.

JavaScript:
const puppeteer = require('puppeteer');
const diameter = "84"; // tank diameter
const length = "167"; // tank length

const volumeMap = new Map();
function sleep (time) {
    return new Promise((resolve) => setTimeout(resolve, time));
  }

const gallons = [
    //Input gallon number here                                                                                                               
    ];
(async () => {
    const browser = await puppeteer.launch({
        headless: false,
        args: ['--headless'],
    })
const page = await browser.newPage();

for (var gallon of gallons) {
    const navigationPromise = page.waitForNavigation({ waitUntil: ['networkidle2'] });
    await page.goto('https://www.handymath.com/cgi-bin/circlehei4.cgi?convdia=in&convlen=in&convol=gal&convhei=in&dia1=&len1=&vol1=&dia2=&len2=&vol2=&numnum=2&submit=Remove+Rows&moreless=1&decimal=5',
    { waitUntil: "domcontentloaded" });
    
    const diameterBox = await page.$x("//input[@name='dia1']");
    await diameterBox[0].click();
    await diameterBox[0].type(diameter);
    
    const lengthBox = await page.$x("//input[@name='len1']");
    await lengthBox[0].click();
    await lengthBox[0].type(length);
    
    const liquidBox = await page.$x("//input[@name='vol1']");
    await liquidBox[0].click();
    await liquidBox[0].type(gallon.toString());
    
    var calculateBtn = await page.$x("//input[@value='Calculate']");
    await calculateBtn[0].click();
    
    await navigationPromise
    //await page.screenshot({ path: 'example.png' });
    const inches = await page.$$eval("body > table > tbody > tr > td:nth-child(2) > table:nth-child(10) > tbody > tr:nth-child(3) > td:nth-child(4)", ele => ele[0].textContent);
    console.log(inches);
}
await browser.close();
})();
 
Upvote 0
Solution

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top