TAN Function (OpenOffice Calc)
The TAN function in OpenOffice Calc returns the tangent of an angle (in radians). Learn syntax, degree conversion, undefined values, examples, and best practices.
Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked
The TAN function in OpenOffice Calc returns the tangent of an angle. TAN is essential for trigonometry, geometry, physics, engineering, slopes, and angle‑based modeling.
What the TAN Function Does
- Computes the tangent of an angle
- Angle must be in radians
- Useful for slopes, angles, rotations, and periodic functions
- Works across sheets
- Pairs naturally with SIN, COS, and ATAN
TAN is ideal when you need slope ratios or angle‑based transformations.
Syntax
TAN(number)
Arguments:
- number — Angle in radians
Degrees * PI() / 180
Important: Undefined Values
TAN is undefined when:
[ \cos(x) = 0 ]
This occurs at:
- ( \frac{\pi}{2} )
- ( \frac{3\pi}{2} )
- ( \frac{5\pi}{2} )
- …and every odd multiple of ( \frac{\pi}{2} )
Calc returns very large positive or negative numbers near these points.
Basic Examples
Tangent of an angle in radians
=TAN(PI() / 4)
Result: 1
Tangent of 45 degrees
=TAN(45 * PI() / 180)
Result: 1
Tangent using a cell reference
=TAN(A1)
(Assumes A1 is in radians.)
Convert degrees to radians inside TAN
=TAN(RADIANS(A1))
Advanced Examples
Slope from angle
=TAN(AngleRadians)
Angle from slope (inverse)
=ATAN(Slope)
Tangent wave
=TAN(2 * PI() * Frequency * Time)
Avoiding undefined values
=IF(COS(A1)=0; NA(); TAN(A1))
Triangle side ratio
Opposite / Adjacent:
=TAN(AngleRadians)
TAN across sheets
=TAN(Sheet1.A1)
TAN in array formulas
=TAN(A1:A10)
Confirm with Ctrl+Shift+Enter.
Tangent of a sum
=TAN(A1 + A2)
Convert slope to angle in degrees
=ATAN(Slope) * 180 / PI()
Common Errors and Fixes
TAN returns extremely large numbers
Occurs when:
- Angle is near an undefined point (odd multiples of π/2)
- COS(angle) ≈ 0
TAN returns unexpected values
Almost always caused by:
- Using degrees instead of radians
- Forgetting to convert:
Degrees * PI() / 180 - Incorrect parentheses
TAN returns Err:502 (Invalid argument)
Occurs when:
- Input is text
- Input is empty
- A malformed reference is used
TAN ignores values you expected it to include
TAN ignores:
- Text numbers (
"123") - Empty cells
- Logical values
- Errors
TAN includes values you expected it to ignore
TAN includes:
- Dates
- Times
- Numeric results of formulas
Err:508 — Missing parenthesis
Usually caused by:
- Missing
) - Using commas instead of semicolons
Best Practices
- Always convert degrees to radians
- Avoid angles where COS(angle) = 0
- Use ATAN or ATAN2 to reverse tangent calculations
- Use named ranges for angles and slopes
- Keep parentheses clean in multi‑step trig formulas