Cylinder Volume Formula

Cylinder volume formula excel

=PI()*A2^2*B2

Inputs

Diameter (d)
cm
Height (h)
cm
Volume
35,342.92 cm³
≈ 35.34 liters
Spreadsheet tank listd = 30 cm, h = 50 cmfx=PI()*(A2/2)^2*B2ABC1DiameterHeightVolume2305035,342.92Units: cm in, cm³ out → 35,342.92 cm³Google Sheets uses the same formula: =PI()*(A2/2)^2*B2
Excel / Google Sheets
=PI()*(A2/2)^2*B2
With the numbers
=PI()*(30/2)^2*50
Python
math.pi * 15**2 * 50

Step by step

  1. Cell A2 = diameter 30, cell B2 = height 50
  2. C2: =PI()*(A2/2)^2*B2
  3. r = d ÷ 2 = 30 ÷ 2 = 15 cm
  4. = π × 15² × 50
  5. = 35,342.92 cm³

Same answer, other units

click to copy

How does the cylinder volume Excel formula calculator work?

The cylinder volume Excel formula calculator builds the spreadsheet formula =PI()*A2^2*B2 (or =PI()*(A2/2)^2*B2 for a diameter) and checks the answer for your numbers.

1A2diameter or radius2B2height3C2=PI()*A2^2*B24Fill downevery row
Cylinder volume Excel formula calculator, from inputs to answer in 4 stages.

The cylinder volume Excel formula calculator works in 5 steps:

  1. 1
    Choose the length unit you use in the spreadsheet.
  2. 2
    Choose diameter or radius, to match what is in column A.
  3. 3
    Enter a sample diameter or radius and height.
  4. 4
    Copy the Excel formula shown under the result into cell C2.
  5. 5
    Fill the formula down; every row gives its own cylinder volume.

Cylinder volume Excel formula formula

The Excel formula for the volume of a cylinder is =PI()*A2^2*B2, with the radius in A2 and the height in B2. With the diameter in A2, use =PI()*(A2/2)^2*B2.

=PI()*A2^2*B2
  • PI()Excel's π, 3.14159265358979
  • A2radius (or diameter ÷ 2)
  • ^2squares the radius
  • B2height or length

How the cylinder volume Excel formula formula is derived

The cylinder volume Excel formula formula comes from 4 steps:

  1. Write V = πr²h with spreadsheet operators: * for ×, ^ for powers.
  2. Use PI() for π; it needs the empty brackets.
  3. Point at the cells: =PI()*A2^2*B2.
  4. Wrap a diameter in brackets before squaring: (A2/2)^2.

Cylinder volume Excel formula formula facts

  • Google Sheets, LibreOffice Calc and Apple Numbers use the same =PI()*A2^2*B2 formula.
  • In Python the same line is math.pi * r**2 * h; a 30 cm × 50 cm cylinder gives 35,342.92 cm³.

Worked example: spreadsheet tank list

Answer: 35,342.92 cm³ (≈ 35.34 liters)

  1. Cell A2 = diameter 30, cell B2 = height 50
  2. C2: =PI()*(A2/2)^2*B2
  3. r = d ÷ 2 = 30 ÷ 2 = 15 cm
  4. = π × 15² × 50
  5. = 35,342.92 cm³

The calculator above opens with these values. Change any input to rework the example.

Cylinder volume Excel formula conversion chart

With A2 = 30 (diameter, cm) and B2 = 50 (height, cm), =PI()*(A2/2)^2*B2 returns 35,342.92 cm³ (35.34 L). The chart lists 6 rows as they would appear in a sheet.

Cylinder volume Excel formula conversion chart
A: diameter × B: heightC: =PI()*(A/2)^2*BLitresUS gal
10 × 20 cm1,570.8 cm³1.570.41
20 × 30 cm9,424.78 cm³9.422.49
30 × 50 cm35,342.92 cm³35.349.34
50 × 80 cm157,079.63 cm³157.0841.5
80 × 120 cm603,185.79 cm³603.19159.34
100 × 150 cm1,178,097 cm³1,178.1311.22

Every value in the cylinder volume Excel formula conversion chart comes from the same calculation as the calculator above.

Excel, Google Sheets and Python formulas

Put the diameter in column A and the height in column B, then type the formula in C2 and fill it down:

TaskFormula
Volume from radius (A) and height (B)=PI()*A2^2*B2
Volume from diameter (A) and height (B)=PI()*(A2/2)^2*B2
Cubic inches to US gallons=C2/231
cm³ to litres=C2/1000
Height for a target volume V (D2)=D2/(PI()*A2^2)
Partly filled horizontal cylinder, radius A2, length B2, depth E2=B2*(A2^2*ACOS((A2-E2)/A2)-(A2-E2)*SQRT(2*A2*E2-E2^2))

In Python, import math then volume = math.pi * r**2 * h. The partly filled horizontal formula is the circular segment area times the length; the tank calculator draws it.

Cylinder volume Excel formula FAQs

What is the Excel formula for the volume of a cylinder?

=PI()*A2^2*B2, with the radius in A2 and the height in B2.

How do I use a diameter in the Excel formula?

Halve it inside the formula: =PI()*(A2/2)^2*B2.

How do I insert the cylinder volume formula in Excel?

Click cell C2, type =PI()*A2^2*B2 and press Enter, then drag the fill handle down the column.

What is the Excel formula for a partly filled horizontal cylinder?

With radius A2, length B2 and liquid depth E2: =B2*(A2^2*ACOS((A2-E2)/A2)-(A2-E2)*SQRT(2*A2*E2-E2^2)).

How do I convert the result to gallons or litres in Excel?

Divide cubic inches by 231 for US gallons, or cm³ by 1,000 for litres: =C2/231 or =C2/1000.

How do you calculate cylinder volume in Python?

Use import math and volume = math.pi * r**2 * h.

Why does Excel show #NAME? for my formula?

You probably typed PI without the brackets. Excel needs PI().