PI Function Examples – Excel, VBA, & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on November 9, 2023
Download Example Workbook

Download the example workbook

This tutorial demonstrates how to use the PI Function in Excel to return the value of PI.



The PI function returns the value of π , 3.14159265358979, accurate to 15 digits.

To use the PI Excel Worksheet Function, select a cell and type:


Decimal places

When using the PI function, Excel stores the value to 15 decimal places. To show more or less decimal places, use the Increase Decimal or Decrease Decimal buttons in the Home menu.

PI Decimal Places

Note: Because π is only calculated to 15 decimal places, exact values for trigonometric functions are not always returned.

Converting to degrees

To convert the value of π to degrees, use PI along with the DEGREES function.


Degree PI

Common Errors

When calculating scalar multiples of π , the operation symbol (like multiply or divide) is necessary. Without it, the following error is displayed.

Common Errors

PI in Google Sheets

The PI Function works exactly the same in Google Sheets as in Excel:

PI Google

PI Examples in VBA

You can also use the PI function in VBA. Type:


Executing the following VBA statement

Range("A1") = Application.WorksheetFunction.Pi()

will produce the following result

Vba PI function

For more information about the PI Formula visit the
Microsoft Website.

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions