Math & trig function

COS function

Returns the cosine of an angle given in radians; used for horizontal distances and force components.

Available in All versions of Excel, Excel for the web, Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

COS(number)
ArgumentWhat it means
numberRequiredThe angle in radians.

Returns: A value from −1 to 1.

How COS works

The cosine of an angle in a right-angled triangle is the adjacent side divided by the hypotenuse, so COS gives the horizontal part of anything that is tilted: how far from the wall a 5 m ladder stands at 75°, the ground distance covered by a sloping conveyor, or the useful horizontal force when a cart is pulled by a rope at an angle.

Cosine is the sine wave shifted by a quarter turn, so it is also used for cyclic models that peak at the start of the cycle, and for rotating coordinates (x′ = x·cos θ − y·sin θ). Excel's trigonometric functions work in radians, not degrees. Convert an angle with RADIANS (or multiply by PI()/180) before passing it in, and convert results back with DEGREES.

Examples

1Distance of a ladder's foot from the wall

D2fx=B2*COS(RADIANS(C2))
ABCD
1LadderLength (m)Angle to ground (°)
2Warehouse5751.29

Result: 1.29

5 × cos(75°) ≈ 1.29 m (2 decimals). The usual safety rule of 1 out for every 4 up corresponds to about 75°.

2Useful pulling force

D2fx=B2*COS(RADIANS(C2))
ABCD
1TaskForce (N)Rope angle (°)
2Pulling a cart20030173.2

Result: 173.2

Only the horizontal part moves the cart: 200 × cos(30°) ≈ 173.2 N (1 decimal).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 13 KB

Common errors and how to fix them

ErrorWhy it happensFix
Wrong resultDegrees passed directly, e.g. COS(60).Use COS(RADIANS(60)), which returns 0.5.
#NUM!|number| is 2^27 or more.Reduce the angle first.

Tips

  • Distance between two GPS points (spherical law of cosines) combines SIN, COS and ACOS of latitudes and longitudes in radians.

Google Sheets

COS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.