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)| Argument | What it means | |
|---|---|---|
number | Required | The 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Ladder | Length (m) | Angle to ground (°) | |
| 2 | Warehouse | 5 | 75 | 1.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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Task | Force (N) | Rope angle (°) | |
| 2 | Pulling a cart | 200 | 30 | 173.2 |
Result: 173.2
Only the horizontal part moves the cart: 200 × cos(30°) ≈ 173.2 N (1 decimal).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
Wrong result | Degrees 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.