Math and trigonometry functions

SQRT

Refuses 2 of 42,806 recorded calls; the rest match

Of 42,806 recorded answers (42,803 in the answer bank and 3 workbook cells), 2 do not match: 2 are refused. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicSQRT
BulgarianSQRT
CzechSQRT
DanishKVROD
GermanWURZEL
GreekSQRT
English (Australia)SQRT
English (United Kingdom)SQRT
English (United States)SQRT
SpanishRAIZ
EstonianSQRT
FinnishNELIÖJUURI
FrenchRACINE
HebrewSQRT
CroatianSQRT
HungarianGYÖK
IndonesianSQRT
ItalianRADQ
JapaneseSQRT
KoreanSQRT
LithuanianSQRT
LatvianSQRT
NorwegianROT
DutchWORTEL
PolishSQRT
Portuguese (Brazil)RAIZ
Portuguese (Portugal)RAIZQ
RomanianSQRT
RussianКОРЕНЬ
SlovakSQRT
SlovenianSQRT
Serbian (Latin)SQRT
SwedishROT
ThaiSQRT
TurkishKAREKÖK
UkrainianSQRT
VietnameseSQRT
Chinese (Simplified)SQRT
Chinese (Hong Kong)SQRT
Chinese (Traditional)SQRT

Names from Microsoft's support site.

What it does

SQRT(number)

SQRT(number) returns the nonnegative real square root. A positive input has two mathematical real roots; this function chooses the positive one. Zero returns zero. Microsoft documents #NUM! for a negative input.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=SQRT(81) returns 9; =SQRT(2) is about 1.414213562373095. Squaring the returned binary64 value need not recover the input exactly.

=SQRT(-9) gives #NUM!. =SQRT(ABS(-9)) returns three because it changes the input to positive nine. Use IMSQRT when a complex root of the original negative value is intended.

The retained build 20430 controls give GEOMEAN(1,2)=1.414213562373095 and SQRT(2)=1.4142135623730951, adjacent binary64 values. FN-GEOMEAN-001 retains the exact cell inputs and both answers. Their mathematical values agree, but the recorded calculation routes do not publish the same bits.

Quirks

Recorded worksheet SQRT uses a root rounded to a 64-bit significand followed by a binary64 store. That can differ by a final bit from one correctly rounded binary64 square root. In the exact-cell control 0x3fefffffffffffff (0.9999999999999999), Excel returns one; a single-rounding mathematical reference returns the preceding binary64 value.

The smallest-subnormal reproduction returned zero, but its cell input was not read back. That observation does not establish a square-root underflow rule: input transfer may already have changed it to zero. A positive finite root itself fits the binary64 normal range even for the smallest positive binary64 input.

Compositions need their own operation order. Squaring two large components before SQRT can overflow when a scaled hypotenuse would be finite. A general POWER route or a logarithm/exponential composition also has different intermediate rounding.

GEOMEAN(1,2) and SQRT(2) return adjacent values in retained build 20430 controls

In two retained build 20430 controls, GEOMEAN(1,2) returned 1.414213562373095 (0x3ff6a09e667f3bcc), while SQRT(2) returned 1.4142135623730951 (0x3ff6a09e667f3bcd). Both functions mathematically return the positive square root of two; the SQRT result is the nearest binary64 value. A fifteen-significant-digit display hides the difference.

FormulaExcelMathematical value
GEOMEAN(1,2)
Excel 16.0 build 20430, Windows 64-bit (NT 10.00), Workbook Compatibility Version 2; CPU not recorded. Captured 29 September 2026.
Inputs and reference value

Number supplied through a cell.

number1: 1
0x3ff0000000000000

number2: 2
0x4000000000000000

Exact rational comparison: 2 lies strictly between the squares of the lower and upper binary64 midpoints around 0x3ff6a09e667f3bcd. Therefore that value is the nearest binary64 square root of 2.

1.414213562373095
0x3ff6a09e667f3bcc
1.4142135623730951
0x3ff6a09e667f3bcd
SQRT(2)
Excel 16.0 build 20430, Windows 64-bit (NT 10.00), Workbook Compatibility Version 2; CPU not recorded. Captured 29 September 2026.
Inputs and reference value

Number supplied through a cell.

number: 2
0x4000000000000000

1.4142135623730951
0x3ff6a09e667f3bcd
—

Inputs, build details and evidence

SQRT is rounded twice, once to 64 bits and once to 53

The worksheet SQRT is RN53(RN64(sqrt(x))): the root is rounded to the x87 unit's 64-bit significand and then stored to binary64. On inputs where that double rounding lands differently from a single rounding, Excel takes the double-rounded value: SQRT(0.9999999999999999) is 1. A subnormal written to a cell reads back as 0, so the 0 for the smallest subnormal below may record that and not SQRT.

FormulaExcelMathematical value
SQRT(0.9999999999999999)
Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture
Inputs and reference value

Number supplied through a cell.

number: 0.9999999999999999
0x3fefffffffffffff

Exact square root at 800 bits, correctly rounded.

1
0x3ff0000000000000
0.9999999999999999
0x3fefffffffffffff
SQRT(1.7976931348623157e+308)
Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture
Inputs and reference value

Number supplied through a cell.

number: 1.7976931348623157e+308
0x7fefffffffffffff

Exact square root at 800 bits, correctly rounded.

1.3407807929942597e+154
0x5ff0000000000000
1.3407807929942596e+154
0x5fefffffffffffff
SQRT(5e-324)
Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture
Inputs and reference value

Number supplied through a cell.

number: 5e-324
0x0000000000000001

0
0x0000000000000000
—

Inputs, build details and evidence

Text to number reads Arabic, Persian, Devanagari and Thai digits, but not fullwidth digits

In the recorded en-ZA settings, converting text to a number accepts Arabic-Indic (U+0660 to U+0669), extended Arabic-Indic (U+06F0 to U+06F9), Devanagari (U+0966 to U+096F) and Thai (U+0E50 to U+0E59) digits. They work alone, in runs, with a decimal point, in the exponent, with a sign or percent, and mixed with ASCII digits or with each other: VALUE("1٢3") is 123, and SQRT of a four-digit string using four scripts is the root of 1234. Fullwidth digits (U+FF10 to U+FF19) give #VALUE! alone or mixed. DATEVALUE reads the four accepted scripts in a date written year-month-day.

Explanation (inferred): That other text-to-number routes, such as arithmetic operators, treat digits the same way is inferred from VALUE and SQRT agreeing.

FormulaExcelMathematical value
=VALUE("١")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

1
0x3ff0000000000000
—
=VALUE("١٢٣")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

123
0x405ec00000000000
—
=VALUE("1٢3")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

123
0x405ec00000000000
—
=VALUE("١e2")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

100
0x4059000000000000
—
=VALUE("१")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

1
0x3ff0000000000000
—
=VALUE("๑")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

1
0x3ff0000000000000
—
=VALUE("1")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#VALUE!—
=VALUE("123")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#VALUE!—
=SQRT("۱٢३๔")
Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file
Inputs and reference value

Typed formula.

35.12833614050059
0x4041906d51932c26
—
=DATEVALUE("٢٠٢٤-٠١-٠٢")
Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file
Inputs and reference value

Typed formula.

45293
0x40e61da000000000
—

Inputs, build details and evidence

How to implement

For the finite nonnegative scalar route, reject negative inputs before the root and return zero for zero. For positive x:

  1. Find the exponent of the root by halving floor(log2(x)), rounding downward. Obtain the input exponent from its bits or exact comparisons.
  2. Round the exact square root to a 64-bit significand, ties-to-even. The portable staged-root recipe finds this with an integer square root and an exact comparison against a squared midpoint. It needs no host extended floating-point type.
  3. Store that rounded root to binary64, again choosing nearest/even. Keep this second step; directly calling a binary64 sqrt removes the recorded first rounding.

Worked boundary: x=1-2^-53. The midpoint between its two possible binary64 root results is m=1-2^-54. Since m*m=x+2^-108, the true root is slightly below m. Rounding it first to 64 significant bits gives m; the binary64 midpoint tie then selects one, whose low significand bit is even. A direct binary64 root instead selects 1-2^-53.

FN-SQRT-001 reports 41,897 matching distinct normal-positive recorded inputs, including all 164 controls where the staged and single-rounding roots differ. Its reproductions name Excel build 20430 on Windows 64-bit. These results support the stated staged route on that evidence, with no published Handbook suite or whole-domain equality claim. The input route and worksheet publication remain separate from the root primitive.

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.

SQRT · 1 lines · calc-func/src/catalogue/math.rs on GitHub
29 sqrt "SQRT" (1, 1) [V "number"] |s, a, sv| { unary(s, a, k::sqrt_fn::sqrt_kernel) }
sqrt_kernel · 6 lines · calc-func/src/ported/sqrt_fn.rs on GitHub
pub fn sqrt_kernel(n: f64) -> Result<f64, WorksheetErrorCode> {
    if n < 0.0 {
        return Err(WorksheetErrorCode::Num);
    }
    Ok(crate::ported::excel_numeric::excel_sqrt_staged(n))
}

Kernels shared with other functions

Argument and result plumbing

  • num catalogue/kit
  • out catalogue/kit

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 buildPlatform and CPUCaptured inputs
19929Windows, bitness not recorded, CPU not recorded42
20430Windows, 64-bit, CPU not recorded42,803
  • XC-SQRT-001: build 19929 versus build 20430; 2 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.

Agreement on these compared inputs does not establish agreement on unmeasured inputs.

Recorded environments and comparison details.

Retained controls from the indexed captures:

Build and recorded CPUCaptured call or argumentsExcel result
19929, CPU not recorded=SQRT(0)0.0 (0x0000000000000000)
20430, CPU not recordedSQRT(2)1.4142135623730951 (0x3ff6a09e667f3bcd)

These are earlier recorded answers, not new Excel runs or an additional cross-build comparison. The function JSON retains each source locator, exact argument bits where available, and input-route status. Call notation does not imply that captured binary64 values were entered as decimal formula literals.

Excel 16.0 build 20430

Windows 64-bit, CPU not recorded in this capture

SQRT(0.9999999999999999) returned 1 (0x3ff0000000000000). SQRT(1.7976931348623157e+308) returned 1.3407807929942597e+154 (0x5ff0000000000000). 1 further recorded control is attached. Inputs were supplied through cells using Value2. These are controls from this environment, not a same-input comparison with another build.

Observed formulas and results
  • SQRT(0.9999999999999999) → 1
    0x3ff0000000000000 (cell-value2)
  • SQRT(1.7976931348623157e+308) → 1.3407807929942597e+154
    0x5ff0000000000000 (cell-value2)
  • SQRT(5e-324) → 0
    0x0000000000000000 (cell-value2)

Excel 16.0.20527.20088

Windows, bitness and CPU not recorded in this reading file

=SQRT("۱٢३๔") returned 35.12833614050059 (0x4041906d51932c26). Inputs were supplied through formula literals. These are controls from this environment, not a same-input comparison with another build.

Observed formulas and results
  • =SQRT("۱٢३๔") → 35.12833614050059
    0x4041906d51932c26 (formula-literal)

Excel 16.0 build 19929

Windows, bitness not recorded, CPU not recorded

42 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build. Retained control =SQRT(0) returned 0.0 (0x0000000000000000). The selected archive row does not record its input plumbing; no input route is inferred.

Observed formulas and results
  • =SQRT(0) → 0.0
    0x0000000000000000 (not-recorded)

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

42,803 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. Retained control SQRT(2) returned 1.4142135623730951 (0x3ff6a09e667f3bcd). The capture specifies exact-double bulk Value2 cell input.

Observed formulas and results
  • SQRT(2) → 1.4142135623730951
    0x3ff6a09e667f3bcd (cell-value2)

Alternatives

IMSQRT accepts complex inputs. SQRTPI includes a multiplication by pi, and IMABS uses a hypotenuse route for complex magnitude. POWER accepts other exponents but must retain its own numerical graph.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents