TAN

Calculate the tangent of an angle (in radians) with Excel's TAN function.

Math & Trigonometry
|
Excel All versions
|
Google Sheets Supported

Spreadsheet editor

Syntax

=TAN(number) Returns: Number

Arguments

Argument Required Description
number Yes The angle in radians for which you want the tangent.

About

The TAN function returns the tangent of an angle you provide in radians. In a right triangle, the tangent is the ratio of the opposite side to the adjacent side. TAN accepts any real number and works with both positive and negative angles.

If your angle is in degrees, convert it first. You can multiply by PI()/180 or use the RADIANS function. For example, =TAN(RADIANS(45)) returns 1 because the tangent of 45 degrees is exactly 1.

TAN pairs well with other trig functions. Use SIN and COS for sine and cosine values, or ATAN and ATAN2 to work backwards from a tangent to an angle.

Examples

Height of a building from distance and angle

Use TAN to turn an angle of elevation into a height estimate. Change the viewing angle or distance and watch the calculated building height update right away.

Spreadsheet editor

Passing degrees instead of radians

Compare the wrong result from raw degree values with the corrected formula beside it. Edit the angle and see why TAN needs radians every time.

Spreadsheet editor

Values close to 90 degrees

See how TAN grows fast as the angle gets close to 90 degrees. Try small changes near that boundary and watch the output jump to much larger numbers.

Spreadsheet editor

Watch out for

Passing degrees instead of radians

You type =TAN(45) expecting the tangent of 45 degrees, but TAN treats 45 as radians and returns a completely different result.

Wrap the value with RADIANS first: =TAN(RADIANS(45)). Or multiply by PI()/180.

Unexpected large numbers near 90 degrees

At angles close to 90 degrees (PI/2 radians) the tangent grows very large, which can look like an error in your spreadsheet.

This is normal math behavior. The tangent approaches infinity at exactly 90 degrees. If you need to handle these edge cases, add an IF check before the TAN call.

Confusing TAN with TANH

Using TANH by mistake returns the hyperbolic tangent, which is a different calculation entirely.

Use TAN for standard trigonometric tangent. TANH is for hyperbolic tangent, which is used in different contexts like engineering curves.

Tips & notes

TAN works in every version of Excel and in Google Sheets. The function always expects radians, so keep the RADIANS function handy when your data is in degrees.

Common questions

Does TAN accept angles in degrees?

No. TAN only works with radians. Convert degrees first with =TAN(RADIANS(degrees)) or =TAN(degrees*PI()/180).

What values can TAN return?

TAN can return any real number, from very large negative to very large positive values. Unlike SIN and COS (which stay between -1 and 1), TAN has no upper or lower bound.

How do I get the angle back from a tangent value?

Use the ATAN function. For example, =ATAN(1) returns about 0.785 radians (45 degrees). If you need the result in degrees, wrap it with DEGREES: =DEGREES(ATAN(1)).