Why Cos 90 Is Not Equal to Zero in Excel?

Sometimes applying trigonometric formulas in Excel does not return the results we expect. When we try to find the value of cos(90) in an Excel sheet for example, it does not return zero as it should. However, we can make it zero with formulas. In this article, we will discuss why cos 90 does not return its exact value, and demonstrate an effective way to return the value of cos(90) as zero in Excel.


The Reason Why Cos(90) Does Not Equal Zero in Excel

In Trigonometry, cos(90) = 0. But when we apply the formula in Excel using the COS function, zero is not returned. Rather, it gives us this value: 6.12574E-17.

The reason is that the Cosine operator works using radian values rather than degree values. Number values can be converted into radians using the formula: the input number * pi (Π) / 180.

So, to find Cos(90):

=Cos (90*Π/180)

=Cos (Π/2)

But here’s the catch! pi (Π) is an infinite decimal, so it will never return a definite value. Excel will cut this number at some point, thereby delivering a very slightly inaccurate result, 6.12574E-17, which is not zero, but very close.


How to Return Cos(90) as Zero (0) in Excel

Suppose we have a dataset with an Angle of 90 degrees. We’ll calculate the Radian and then apply the COS function to find cos(90).


Step 1 – Convert the Degree to Radians

We’ll convert the numeric value to a radian unit using the RADIANS function.

  • Choose a cell (C5) and enter the following formula:
=RADIANS(B5)

Calculation of Radians to determine Cos90 not zero

  • Press Enter to convert the number to an angle.

Read More: Cos Squared in Excel


Step 2 – Calculate the Value of Cos(90)

Now we will determine the result of Cos(90) using the COS function.

  • Select a cell (D5) and apply the following formula:
=COS(C5)

Determine Cos90 Output to calculate cos 90 not zero in excel

  • Press Enter.

The output is 6.12574E-17 when it should be 0.

Determine Cos90 Output to calculate cos 90 not zero in excel


Step 3 – Combine the ROUND, COS, and RADIANS Functions to Return the Correct Value of Cos(90)

To get the correct output, we’ll round the number.

  • Choose a cell (E5) and enter the following formula:
=ROUND(COS(RADIANS(B5)),12)

  • Press Enter.

The correct output is returned.

 Cos 90 Is Not Zero in Excel

Read More: Excel COS Function Is Returning Wrong Output?


Things to Remember

  • While applying the COS function, convert numeric degree values to angles using the RADIANS function first.

Download Practice Workbook


Related Article


<< Go Back to Excel COS Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Wasim Akram
Wasim Akram

Wasim Akram holds a BSc degree in Industrial and Production Engineering from Ahsanullah University of Science and Technology. Over the past 2 years, he has been actively contributing to the ExcelDemy project, where he has authored more than 150 articles. Now, he is working as an Excel VBA and Content Developer. He likes learning new things about Microsoft Office, especially Excel VBA, Power Query, Data Analysis, and Excel Statistics. He is also very interested in machine learning and... Read Full Bio

2 Comments
  1. Al decimal 17 empieza esta falla. Entonces aplicaría el mismo error para los demás valores de ángulo haciendo que estos sean ¿Inexactos a partir del decimal 17?. Microsoft debe tener en cuenta esto y actualizar sus parámetros para evaluar cos90°;cos270°;sen180°. ¿Alguien se ha contactado con Microsoft al respecto?

    Gracias por la información.

  2. Dear LUNDER,

    My understanding of your statement implies that there is an issue with the calculations being performed in Microsoft Excel, specifically with the trigonometric functions cosine (cos), cosine (cos), and sine (sin) for certain angle values.

    Further, I concur that the error seems to affect the precision of the results starting from the 17th decimal place, which makes the calculated values for the angles cos 90°; cos 270°; sin 180° to be inaccurate. However, it is important to note that the internal representation of floating-point numbers in computers can lead to inaccuracies, especially when working with very small or large numbers, or when performing multiple mathematical operations.

    In these cases, you can take the following steps to resolve this issue.

    1. Use the RADIANS function to convert the angle from degrees to radians before evaluating the trigonometric functions.
    2. Increase the number of decimal places used in the calculations by using the ROUND or ROUNDUP functions.

    Best Regards,
    Yousuf Khan (ExcelDemy Team)

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo