Returns the tangent of an angle given in radians. Essential for trigonometry, engineering calculations, and mathematical analysis. Tangent values can be any real number and become undefined at 90° and 270° (±π/2).
Master the fundamentals of Excel TAN function
The TAN function returns the tangent of an angle given in radians. Tangent is defined as the ratio of sine to cosine: tan(θ) = sin(θ)/cos(θ). TAN can return any real number and is undefined at 90° and 270° (±π/2 radians). Essential for trigonometry, engineering calculations, and mathematical analysis.
Input angle must be in radians
Output can be any real number
Repeats every π radians (180°)
Undefined at 90° and 270°
Function-specific parameters
Function-specific return type
Solve triangle problems and angle calculations
Calculate slopes, angles, and forces
Perform mathematical calculations and analysis
Perform scientific computations
Exact matching required
Returns numeric position
Handles missing text gracefully
=TAN(number)The angle in radians for which you want the tangent. If angle is in degrees, use RADIANS() to convert first.
The tangent of the angle (can be any real number)
Description: Returns the tangent of an angle given in radians
Calculate tangent of angle
Returns 0 because tan(0°) = 0. TAN(0) = tan(0 radians) = tan(0°) = 0.
Use TAN function in VBA
' Basic TAN in VBA
Range("C1").Value = Application.WorksheetFunction.Tan(Application.WorksheetFunction.Radians(45))
' Returns: 1
' Calculate tangent of angle in degrees
Sub CalculateTangent()
Dim angleDegrees As Double
angleDegrees = Range("A1").Value
Dim angleRadians As Double
Dim tangent As Double
angleRadians = Application.WorksheetFunction.Radians(angleDegrees)
tangent = Application.WorksheetFunction.Tan(angleRadians)
Range("B1").Value = tangent
End Sub
' Calculate opposite side in triangle
Sub TriangleOpposite()
Dim angleDegrees As Double, adjacent As Double
angleDegrees = Range("A1").Value
adjacent = Range("B1").Value
Dim opposite As Double
opposite = Application.WorksheetFunction.Tan( _
Application.WorksheetFunction.Radians(angleDegrees)) * adjacent
Range("C1").Value = opposite
End Sub
' Handle undefined values
Sub SafeTAN()
Dim angleDegrees As Double
angleDegrees = Range("A1").Value
If angleDegrees = 90 Or angleDegrees = 270 Then
Range("B1").Value = "Undefined"
Else
Range("B1").Value = Application.WorksheetFunction.Tan( _
Application.WorksheetFunction.Radians(angleDegrees))
End If
End SubCalculate opposite side in right triangle
Calculate slope from angle
Calculate angles and forces in engineering
Perform mathematical calculations
TAN returns unexpected value with degrees
=TAN(RADIANS(45)) not =TAN(45)Solution: TAN requires radians, not degrees. Always convert: TAN(RADIANS(degrees)). TAN(45) is not tan(45°), it's tan(45 radians).
TAN returns error or very large number at 90°
=IF(OR(A1=90, A1=270), "Undefined", TAN(RADIANS(A1)))Solution: TAN is undefined at 90° and 270° (±π/2). Use IF to handle: IF(OR(angle=90, angle=270), "Undefined", TAN(RADIANS(angle))).
TAN returns very large numbers near 90°
Check angle: IF(ABS(angle-90)<0.001, "Near undefined", TAN(RADIANS(angle)))Solution: This is expected behavior - TAN approaches infinity at 90°. Check if angle is exactly 90° or very close. Handle with conditional logic.
TAN results have unexpected precision
=ROUND(TAN(RADIANS(45)), 4)Solution: Use ROUND for display: ROUND(TAN(RADIANS(angle)), digits). TAN can return very large numbers that need formatting.
Uncertainty about TAN vs ATAN relationship
TAN(ATAN(1)) = 1Solution: TAN is inverse of ATAN: TAN(ATAN(value)) = value. ATAN(TAN(angle)) = angle (in radians, within -π/2 to π/2).