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?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,
1234567891011121314151617181920212223242526272829303132
1638649312616119924028232737442347452753163769575581687894310081076114412141285135814311506158116581736
22262933353841424547495153410658606162656568687071737375757778
434233132222-49102-48211303021202021
1.5 x (Inches)2 + 17.8 * (Inches)(Inches-17) x 70 + 685
19.341.666.995.2126.5160.8198.1238.4281.7328377.3429.6484.9543.275582589596510351105117512451315138514551525159516651735
1234567891011121314123456789101112131415
3.33.62.92.20.50.20.91.60.313.36.610.916.209172227293131302724191471

The 2nd common difference goes crazy at inches ,15, 16, 17, in red.

So a rough formula for Inches 1 - 14 is as before 1.5 x (Inches)2 + 17.8 * (Inches)

A rough formula for Inches 18 - 32 is as before (Inches-17) x 70 + 685

The 2nd formula produces a normal distribution curve, with the differences from the original data sheet; so more could be done.

Jamie
 
Upvote 0
@igold Post #17

Still does not confirm the shape. To tell you the truth, all gasoline and diesel tanks that I dealt with, and that are hundreds over the years, always have been round tanks.
The majority standing up but smaller, and this is relative, laying down.
Either one can be calculated but if the OP is not willing to give us all the information, no use spending time on possibilities.
 
Upvote 0
Re: Size = 96 * 192
I guess it is too much to ask to be more specific. Are the above measurements inches, feet, cm, meters or what.
On a horizontal round tank with dimensions of 96 inches by 192 inches, the capacity is 6016.19 gallons which is pretty close to what OP mentions.
However, at 1 inch fluid level, there will be 10.8 gallons. Not 16 as OP suggests.

Horizontal Round Tank Volumes.jpg
 
Upvote 0
Headers.JPG


Just read the "headline" What I asked for previously is not needed. My apologies.
"Formula to calculate the inches given tank size, length, and diameter and gallons per inch"

Make sure to check results as this is from an old workbook that I have never used and also never checked for accuracy.
Never heard back from the OP that it was presented to if it was right or not.

Set up your sheet as in picture.
Add two "Form Control" Buttons as shown in picture (or wherever).
Copy both codes and paste in a regular module (Module1 maybe).

This code works on the "Make List" Button.
Code:
Sub Make_List_Inch_Gal()
Dim a As Long, i As Long, j As Long
a = WorksheetFunction.Ceiling(Range("K1"), 5) \ 5    '<--- Backward slash to make result an integer in case there are decimals in cell K1
Application.ScreenUpdating = False
    With Range("A4:A" & 3 + Range("K1").Value \ 1)    '<--- Backward slash to make result an integer in case there are decimals in cell K1
        .Formula = "=Row()-3"
        .Value = .Value
        .Offset(, 1).Formula = "=(R1C7*(R1C11/2)^2)*(ACOS(1-(2*(RC1))/R1C11)-(SIN(ACOS(1-(2*(RC1))/R1C11))*COS(ACOS(1-(2*(RC1))/R1C11))))*0.004329"
        .Offset(, 1).Value = .Offset(, 1).Value
        .Offset(, 1).NumberFormat = "0.000"
    End With

    j = 4 + a
    
    For i = 4 To 13 Step 3
        Range(Cells(j, 1), Cells(j + a - 1, 1)).Resize(, 2).Copy Cells(4, i)
        j = j + a
    Next i
    
Range("A" & a + 4 & ":B" & Range("K1").Value \ 1 + 4).EntireRow.Delete Shift:=xlUp    '<--- Backward slash to make result an integer in case there are decimals in cell K1
ActiveSheet.PageSetup.PrintArea = Range("A1").CurrentRegion.Resize(, 14).Address 
Application.ScreenUpdating = True
End Sub


This code works on the "Clear List" Button.
Code:
Sub Undo_Inch_Gallons()
    Range("A1:N" & Cells(Rows.Count, "A").End(xlUp).Row).Offset(3).Delete Shift:=xlUp
End Sub
 
Upvote 0
View attachment 71987

Just read the "headline" What I asked for previously is not needed. My apologies.
"Formula to calculate the inches given tank size, length, and diameter and gallons per inch"

Make sure to check results as this is from an old workbook that I have never used and also never checked for accuracy.
Never heard back from the OP that it was presented to if it was right or not.

Set up your sheet as in picture.
Add two "Form Control" Buttons as shown in picture (or wherever).
Copy both codes and paste in a regular module (Module1 maybe).

This code works on the "Make List" Button.
Code:
Sub Make_List_Inch_Gal()
Dim a As Long, i As Long, j As Long
a = WorksheetFunction.Ceiling(Range("K1"), 5) \ 5    '<--- Backward slash to make result an integer in case there are decimals in cell K1
Application.ScreenUpdating = False
    With Range("A4:A" & 3 + Range("K1").Value \ 1)    '<--- Backward slash to make result an integer in case there are decimals in cell K1
        .Formula = "=Row()-3"
        .Value = .Value
        .Offset(, 1).Formula = "=(R1C7*(R1C11/2)^2)*(ACOS(1-(2*(RC1))/R1C11)-(SIN(ACOS(1-(2*(RC1))/R1C11))*COS(ACOS(1-(2*(RC1))/R1C11))))*0.004329"
        .Offset(, 1).Value = .Offset(, 1).Value
        .Offset(, 1).NumberFormat = "0.000"
    End With

    j = 4 + a
   
    For i = 4 To 13 Step 3
        Range(Cells(j, 1), Cells(j + a - 1, 1)).Resize(, 2).Copy Cells(4, i)
        j = j + a
    Next i
   
Range("A" & a + 4 & ":B" & Range("K1").Value \ 1 + 4).EntireRow.Delete Shift:=xlUp    '<--- Backward slash to make result an integer in case there are decimals in cell K1
ActiveSheet.PageSetup.PrintArea = Range("A1").CurrentRegion.Resize(, 14).Address
Application.ScreenUpdating = True
End Sub


This code works on the "Clear List" Button.
Code:
Sub Undo_Inch_Gallons()
    Range("A1:N" & Cells(Rows.Count, "A").End(xlUp).Row).Offset(3).Delete Shift:=xlUp
End Sub
Basically i need to know this calculator works i just found on the internet
 
Upvote 0
You can check that out yourself. I am sure that it will give you a true answer.
 
Upvote 0
This should do what you want.
First you need to calculate the volume
1660931123756.png

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
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
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