Purpose

Return value

Syntax

=SQRT(number)
  • number - The number to get the square root of.

Using the SQRT function

The Excel SQRT function returns the square root of a positive number. SQRT returns an error if number is negative.

The SQRT function takes one argument, number , which must be a numeric value. If number is not numeric, SQRT returns a #VALUE! error. If number is negative, SQRT returns a #NUM! error.

Examples

=SQRT(9) // returns 3
=SQRT(81) // returns 9
=SQRT(144) // returns 12
=SQRT(0.25) // returns 0.5
=SQRT(0) // returns 0

Negative numbers

The SQRT function will return a #NUM! error when number is negative:

=SQRT(-9) // returns #NUM!

To get the square root of a negative number (as if the number was positive), wrap the number in the ABS function like this:

=SQRT(ABS(-9)) // returns 3

Notes

  • If number is not numeric, SQRT returns a #VALUE! error.
  • If number is negative, SQRT returns a #NUM! error.

Purpose

Return value

Syntax

=SQRTPI(number)
  • number - A positive number to multiply by π before taking the square root.

Using the SQRTPI function

The SQRTPI function calculates the square root of (number × π). This is equivalent to SQRT(number*PI()) but provides a more direct way to perform this calculation. The function returns a numeric value accurate to 15 digits.

=SQRTPI(1) // returns 1.77245385090552 (square root of π)

If the number argument is negative, SQRTPI returns a #NUM! error. If the number argument is not numeric, SQRTPI returns a #VALUE! error.

Basic Examples

=SQRTPI(1) // returns 1.772453851 (square root of π)
=SQRTPI(4) // returns 3.544907702 (square root of 4π)

Comparison with Equivalent Formula

The SQRTPI function provides the same result as combining the SQRT and PI functions:

=SQRTPI(9) // 5.31736155271656
=SQRT(9*PI()) // 5.31736155271656 (equivalent)

Error Handling

The SQRTPI function will return errors in the following cases:

  • #NUM! error: When the number argument is negative
  • #VALUE! error: When the number argument is not numeric
=SQRTPI(-1) // Returns #NUM! error
=SQRTPI("text") // Returns #VALUE! error
=SQRTPI(TRUE) // Returns #VALUE! error