If you want to turn a cosine value back into its angle, the ACOS function gives you the inverse cosine in radians.
In this article, I’ll show you how to return angles in radians and degrees, then use ACOS for ramp and route calculations.
In Excel 2021 and later, you can also feed ACOS a range, and the results will spill into the cells below.
ACOS Function Syntax in Excel
The ACOS function returns the inverse cosine of a number as an angle in radians.
=ACOS(number)
- number (required): The cosine value for the angle you want. It must be between -1 and 1.
ACOS returns an angle from 0 to PI radians. If you need degrees, wrap ACOS inside the DEGREES function.
When to Use ACOS Function
- Convert a known cosine value into an angle.
- Return an angle in radians for a trigonometric calculation.
- Calculate a ramp angle from its horizontal run and sloped length.
- Find the smaller angle between two vectors when you know their components.
Example 1: Convert Cosines to Radians
ACOS returns radians by default, so that is where we’ll begin.
Below is the dataset. Column A contains seven cosine values from -1 through 1, and column B is reserved for their angles in radians.

We want to calculate the inverse cosine of every value in column A with one formula.
Here is the formula to enter in B2:
=ACOS(A2:A8)

The formula spills through B8. A cosine of -1 returns 3.1415927 radians, 0 returns 1.5707963, and 1 returns 0.0000000.
The results move downward as the cosine values increase. ACOS always returns the angle between 0 and PI radians whose cosine matches the input.
Pro Tip: Radians are Excel’s standard unit for trigonometric functions. PI radians equals 180 degrees, and PI/2 radians equals 90 degrees.
Example 2: Convert ACOS to Degrees
Degrees are usually easier to read when you are describing a physical angle.
Below is the dataset. Column A contains eight cosine values, and column B will show the corresponding angles in degrees.

We want to convert each ACOS result from radians to degrees as part of the same spilling formula.
Here is the formula to enter in B2:
=DEGREES(ACOS(A2:A9))

ACOS first returns each angle in radians. DEGREES then converts those results before they spill into B2:B9.
For example, -0.8 returns 143.13 degrees, 0 returns 90.00 degrees, and 0.5 returns 60.00 degrees.
Pro Tip: Keep DEGREES outside ACOS. The input to ACOS is a cosine value, while DEGREES converts the angle that ACOS returns.
Example 3: Calculate Ramp Angles
The next example uses ACOS with measurements instead of prepared cosine values.
Below is the dataset. Each row lists a ramp ID, its horizontal run, its sloped length, and an empty column for the ramp angle.

We want to calculate the angle between each ramp and the horizontal ground.
Here is the formula to enter in D2:
=DEGREES(ACOS(B2:B9/C2:C9))

For a right triangle, horizontal run divided by ramp length gives the cosine of the ramp angle. ACOS converts that ratio back into an angle.
DEGREES makes the spilled results easier to interpret. RMP-101 has a 24-foot run and a 25-foot length, so its angle displays as 16.26 degrees.
The same formula returns 53.13 degrees for RMP-104, whose 18-foot run is much shorter than its 30-foot ramp length.
Pro Tip: The horizontal run cannot exceed the ramp length in this setup. If the ratio is above 1, ACOS returns #NUM!.
Example 4: Find Angles Between Routes
This final example calculates the smaller angle between two directions.
Below is the dataset. Each row contains the east and north components of two route vectors, plus a column for the angle between them.

We want to find the angle between each pair of routes from their two-dimensional vector components.
Here is the formula to enter in F2:
=DEGREES(ACOS((B2:B9*D2:D9+C2:C9*E2:E9)/(SQRT(B2:B9^2+C2:C9^2)*SQRT(D2:D9^2+E2:E9^2))))

The numerator multiplies matching east and north components, then adds them. This is the dot product for each pair of routes.
Each SQRT expression calculates a route’s length. Dividing the dot product by both lengths produces the cosine value that ACOS needs.
RP-04 contains parallel vectors and returns 0.00 degrees. RP-02 and several other perpendicular pairs return 90.00 degrees.
RP-07 points in two different directions but is not perpendicular. Its smaller angle is 45.24 degrees.
Pro Tip: Neither route vector can have zero length. A vector with both components equal to zero makes the denominator zero and causes a #DIV/0! error.
Tips & Common Mistakes
- Keep inputs within the valid range. ACOS accepts values from -1 through 1. A value outside that range returns
#NUM!. - Remember the default unit. ACOS returns radians. Use DEGREES around the ACOS result when you want an angle from 0 through 180 degrees.
- Leave the spill area empty. In Excel 2021 and later, a range-based ACOS formula spills automatically. Occupied output cells cause #SPILL!.
- Check for implicit intersection. An
@added before ACOS can reduce a range calculation to one result instead of a spilled list. - Use a legacy fallback when needed. Excel 2019 and earlier do not support this spill behavior. Enter a single-row formula and copy it down instead.
- Choose the right angle function. ACOS returns the smaller unsigned angle. If direction or quadrant matters, calculate each route’s direction with ATAN2 before comparing them.
- Protect the vector calculation. A zero-length vector causes division by zero, and floating-point rounding can sometimes push the calculated ratio just outside ACOS’s valid range.
I covered how ACOS returns radians, converts results to degrees, and solves practical angle problems with spilling formulas.
I hope you found this article helpful.
Other Excel articles you may also like: