SEC Function (LibreOffice Calc)
Calculate secants in LibreOffice Calc with SEC. Convert degree inputs, check reciprocal cosine and avoid unstable results near odd multiples of 90 degrees.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: SEC returns the secant of an angle measured in radians. Its mathematical definition is 1/COS(angle). Convert degree measurements with RADIANS before supplying them to SEC.
Syntax and argument
=SEC(angle)
Angle is required. It can be a numeric constant, a cell reference or a numeric expression in radians. There are no optional arguments or settings for degree mode. The English function name is used here; localized function names and separators depend on Calc configuration.
Worked example: convert a degree-angle table
Enter this small table, keeping the degree unit in the heading:
| Cell | A: Angle in degrees | B: Formula | Expected result |
|---|---|---|---|
| Row 2 | 0 | =SEC(RADIANS(A2)) |
1 |
| Row 3 | 45 | =SEC(RADIANS(A3)) |
approximately 1.4142135624 |
| Row 4 | 60 | =SEC(RADIANS(A4)) |
approximately 2 |
| Row 5 | -60 | =SEC(RADIANS(A5)) |
approximately 2 |
- Put 0, 45, 60 and -60 in A2:A5.
- Enter the formula in B2 and copy it down through B5.
- Compare B3 with
=SQRT(2)and B4 with 2.
The expected values follow from reciprocal cosine. The 45-degree and 60-degree values also agree with the official Help examples. All are independently calculated expectations here, not fresh application results.
Second example: supply radians directly
=SEC(PI()/3) is expected to give approximately 2 because PI()/3 radians is 60 degrees. Do not wrap an already-radian input in RADIANS: that would convert it a second time.
Negative angles have the same secant as their positive counterpart because cosine is even. =SEC(-PI()/3) therefore also has expected value approximately 2. This symmetry is a useful check on an imported angle column.
Advanced application: recover a segment length from a projection
For a mathematical geometry model, suppose a segment’s horizontal projection is 12 metres and its inclination is 60 degrees. Put 12 in D2 and 60 in E2. =D2*SEC(RADIANS(E2)) gives an independently expected segment length of approximately 24 metres.
The relationship is length = projection/cos(angle). Keep the angle measured relative to the horizontal axis; measuring from the vertical would require a different relationship. This example demonstrates the formula, not validation of a physical design or measurement.
Singularities and troubleshooting
Mathematically, secant is undefined where cosine is zero, at PI()/2 plus any whole multiple of PI(), equivalent to odd multiples of 90 degrees. Near those angles a small input error can cause a very large change in the result.
Spreadsheet arithmetic represents PI() and trigonometric values approximately. A formula at an apparent exact singularity may produce a very large finite number or an error depending on implementation and rounding. Do not treat a large finite result as a meaningful secant at 90 degrees, and do not rely on one unverified error code for every near-singular input.
For a worksheet with measured angles, inspect =ABS(COS(RADIANS(A2))) as a denominator check. A chosen tolerance is a modeling decision based on measurement precision; it is not a universal cutoff built into SEC. Avoid hiding an unstable result by rounding the input to an arbitrary number of decimals.
If the result is unexpected, check degree versus radian units, numeric rather than text inputs, and whether the angle is near an undefined point. SEC is different from SECH, which is hyperbolic and has no real-valued cosine zeros.
Availability and verification
LibreOffice Help identifies introduction in LibreOffice 3.5. The current desktop Calc reference was checked October 17, 2026; a last functioning version or retirement is not established.
New expected results are independently calculated and checked against the documented contract, not tested in LibreOffice Calc. No screenshot or fresh application execution is claimed.