Excel: How to Calculate Odd and Even Negative Nth RootsLast reviewed: November 30, 1994Article ID: Q93733 |
The information in this article applies to:
SUMMARYWhen you raise a negative value to a fractional exponent in Microsoft Excel, you may receive a #NUM error value. This error value may occur because the solution may not be defined in the real number system. To calculate the nth root of a negative number, use the appropriate formula below. Note: The formulas are different for even (1/2, 1/4,...) and odd (1/3, 1/5,...) roots.
MORE INFORMATION
Calculating Even Roots of Negative NumbersAlthough even roots of negative numbers are undefined in the real number system, they do have solutions in the complex number system. To calculate these roots in Microsoft Excel, use complex number functions. The following example demonstrates how to calculate the complex formula -25^(1/8):
A1: =COMPLEX(-25,0) B1: convert to a complex number A2: =IMSQRT(IMSQRT(IMSQRT(a1))) B2: same as raising to power of 1/8Cell A2 returns the value 1.381522133 + 0.572245204i. Note: This formula only works for roots that are a power of 2 (that is, 2, 4, 8,...). For even roots that are not necessarily powers of 2, use the following formula:
A1: <Real part> A2: <Imaginary part> A3: =COMPLEX(A1,A2) A4: =IMABS(A3) A5: =IMARGUMENT(A3) A6: <desired root> (2, 4, 6, 10,...) A7: <number of iterations> A8: <Constant K> goes from 0,1,...,(root-1) A9: =COS(A5/A6+A7)*(A4^(1/A6)) A10: =SIN(A5/A6+A7)*(A4^(1/A6)) A11: =COMPLEX(A9,A10)To use the above formula:
Calculating Odd Roots of Negative NumbersOdd roots do exist in a real number system and can be calculated by taking the odd root of the absolute value of the negative number and multiplying the result by -1 (negative one). For example, to calculate the formula - 25^(1/3), follow the steps below:
A1: =(ABS(-25)^(1/3))*-1This formula will return -2.92402. If you have a column containing mixed positive and negative numbers, and you want to calculate the nth odd roots for each of them, use the following formula
=IF(ISERROR(CellRef^(1/3)),(ABS(CellRef)^(1/3)*-1),CellRef^(1/3))where "CellRef" is the reference to the cell that contains the number. In this formula, CellRef should reference the first cell in your column of negative and positive numbers. To get results for each of the numbers in your column of numbers, fill the formula down as needed.
REFERENCES"Mathematical Applications," Ronald J. Harshbarger and James J. Reynolds, D.C. Heath and Company, 1985, Massachusetts. "Microsoft Excel Function Reference," version 4.0, pages 60, 228-235.
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |