PI() returns Excel's floating-point approximation to π, the ratio of a circle's circumference
to its diameter. It takes no arguments. Use PI()*radius^2 for a circle's area and 2*PI()*radius
for its circumference when ordinary floating-point arithmetic is appropriate.
In the recorded Excel 16.0.20527.20088 capture, the returned binary64 is
0x400921fb54442d18, approximately 3.141592653589793. This is the nearest binary64 value to π;
it is still a finite approximation to an irrational number.
Try it
Calculate =PI() to see the decimal and raw binary64 bits. Compare =PI()-3.14159265358979 to
see why a decimal copied from a documentation display is not the same stored constant.
Quirks
Microsoft's description gives π to fifteen significant decimal digits. Parsing that shorter
decimal, 3.14159265358979, produces binary64 0x400921fb54442d11, seven representable steps below
the recorded PI result. The description is not an instruction to store that truncated string.
Identities involving exact π need not hold exactly when evaluated with a rounded constant and
rounded arithmetic. Multiplying or dividing this normal binary64 constant by 2 is exact in
binary arithmetic; dividing by 3 or 180 generally introduces another rounding.
The order of operations also matters: x*PI()/180 and x*(PI()/180) round at different places.
Their mathematical equality does not imply identical numeric results.
How to implement
For the recorded constant, construct binary64 from the 64-bit pattern 0x400921fb54442d18 or
the equivalent hexadecimal floating-point literal 0x1.921fb54442d18p+1. Return a numeric value
and reject an argument-bearing call at the formula boundary. Computing π through a platform
inverse-trigonometric function adds an unnecessary dependency on that function's rounding.
Keep a worksheet PI constant separate from a high-precision constant used inside trigonometric
argument reduction. Reducing a large angle with only a rounded binary64 π loses information;
many-word reduction methods address a different problem from returning this worksheet constant.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
24 pi "PI" (0, 0) [] |s, a, sv| { s.number(std::f64::consts::PI) }
No implementation has been published with a Handbook test suite for this function.
Version differences
The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.
Excel 16.0 build
Platform and CPU
Captured inputs
20430
Windows, 64-bit, CPU not recorded
1
The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.
1 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.
Alternatives
RADIANS and DEGREES convert angle units; they have their
own arithmetic and rounding order. SQRTPI computes a function involving π.
Use a higher-precision representation when the surrounding calculation needs more precision
than binary64 can retain.