SEC Function (Gnumeric)
Learn the SEC function in Gnumeric: Return the secant of an angle. SEC(x)=1/COS(x).
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked
Quick answer
For a 60° input, use =SEC(RADIANS(60)). The independently calculated expected result is approximately 2. Gnumeric expects radians; it does not treat the number 60 as 60 degrees.
What SEC does, and when to use it
SEC returns the secant of an angle: the reciprocal of cosine. It is useful when a known adjacent side must be converted to a hypotenuse, or when inspecting reciprocal trigonometric relationships.
SEC(x) = 1/COS(x) for real x where cosine is not zero. Secant can be positive or negative depending on the quadrant. Because cosine is even, SEC(-x) = SEC(x) where defined.
Exact syntax and arguments
=SEC(x)
SEC(x) — one required numeric argument x, interpreted as an angle in radians; no optional arguments or documented defaults.
To read a source cell rather than a literal, use =SEC(A2). Cell formulas begin with = in Gnumeric. A function with one argument has no multi-argument separator, so these examples avoid ambiguity between commas and semicolons. The tables use the English decimal-point convention, such as 0.5; Gnumeric’s local numeric format depends on locale and operating system. Check locale and spreadsheet parsing if your system expects a decimal comma. The identity statements below are mathematical deductions rather than quoted implementation promises. Formula-entry reference; Gnumeric locale reference.
Copyable examples and expected outputs
The following table contains independently calculated mathematical expectations, not observed Gnumeric results. Expected numbers are rounded to eight decimal places for display; formulas may return additional digits. All examples use Gnumeric’s documented function syntax.
| Formula | Expected output | What it demonstrates |
|---|---|---|
=SEC(0) |
1.00000000 | zero angle |
=SEC(PI()/6) |
1.15470054 | 30 degrees as a radian fraction |
=SEC(PI()/4) |
1.41421356 | 45 degrees as a radian fraction |
=SEC(RADIANS(60)) |
2.00000000 | 60 degrees converted |
=SEC(RADIANS(-60)) |
2.00000000 | even symmetry |
=SEC(RADIANS(120)) |
-2.00000000 | second quadrant, negative result |
=12*SEC(RADIANS(30)) |
13.85640646 | right-triangle hypotenuse with adjacent side 12 |
=1/COS(RADIANS(30)) |
1.15470054 | equivalent identity |
For a simple start, enter the first formula in any empty cell and verify that the result is plausible. Then copy a data-driven example into a column, replace constants with cell references and compare against an independent identity. If a near-singular formula gives a very large result, check the input’s domain before treating the cell as a measurement.
Practical and advanced applications
Right-triangle height and extension
Suppose the adjacent horizontal distance is 12 m and the angle from horizontal is 30°. The slanted distance is adjacent / COS(angle):
=12*SEC(RADIANS(30))
Independently calculated expected distance: 13.85640646 m. This relationship assumes a right triangle and that 12 is the side adjacent to the stated angle, not the opposite side.
Build a small angle comparison table
Enter degree values 0, 30, 45, 60 in A2:A5. In B2, enter:
=SEC(RADIANS(A2))
Copy it down. Expected (rounded to six decimal places): 1.000000, 1.154701, 1.414214, 2.000000. You can independently cross-check =1/COS(RADIANS(A2)) in column C. Differences at the last decimal place may be floating-point effects.
A near-vertical precaution
If an application must exclude angles near 90° or 270°, validate the source angle before evaluating. For a practical rule in degrees, =IF(ABS(COS(RADIANS(A2)))<0.000001,"near singularity",SEC(RADIANS(A2))) expresses a tolerance-based guard. This is an illustrative unexecuted Gnumeric formula, not a claim about built-in error behavior. Choose a tolerance appropriate to the scale of your measurements.
Common errors, limits and troubleshooting
- Wrong angle unit:
=SEC(60)means 60 radians, not 60 degrees. Use=SEC(RADIANS(60))if you mean 60°. - Undefined values: Secant is mathematically undefined where
COS(x)=0, such asπ/2 + kπ. Avoid using inputs at or too close to such angles; rounding may produce extremely large finite results rather than a neat error. - Do not divide by an assumed exact zero:
PI()/2is an approximation on the computer. Even if its cosine is theoretically zero, finite-precision evaluation need not return exact zero. - Cell contains text or an error: a numeric-function call may fail or propagate an earlier error. Gnumeric’s function section does not specify an exact error label for every coercion case; verify it natively.
- Magnitude/precision: near the singularity, small changes to an angle can cause large changes in SEC. Round final display only after computing, and add a domain guard where your use case requires one.
How to diagnose a surprising value: inspect the underlying numeric cell, check units (radians versus dimensionless hyperbolic inputs), test a simple known case, compare with the identity only in a numerically safe range, and confirm the workbook’s locale. Record the application version and the exact error shown before adding specific product-error claims. The official short documentation does not fully specify behaviour for blanks, text values, machine overflow, or all singularities.
Cross-compatibility: Gnumeric, Excel and OpenDocument
Gnumeric’s online manual labels SEC not Excel compatible and documents that its OpenDocument export translates SEC(x) to 1/COS(x). That compatibility label reflects the manual’s classification; it is not proof the function is absent from current Excel. Microsoft’s current documentation confirms SEC(number) in listed modern Excel versions (including 2016, 2019, 2021, 2024 and Microsoft 365), with additional Excel-specific input constraints such as |number| < 2^27. Do not transfer Excel’s constraint automatically to Gnumeric without native verification. In older spreadsheet versions, =1/COS(x) is the portable mathematical alternative provided the cosine denominator is nonzero.
Compatibility may also depend on worksheet file format and the exact importer/exporter. Merely documenting a function in two programs does not prove bit-for-bit identical precision, error codes or conversion behaviour. See Gnumeric’s manual and Microsoft’s current SEC documentation, accessed 2026-10-12.
Frequently asked questions
Does SEC use degrees? No: its single required input is radians; wrap degree values in RADIANS.
Is SEC the same as COS? No: SEC is the reciprocal of COS where COS is nonzero.
Why is SEC near 90° enormous? Secant becomes undefined where cosine is zero. Floating-point representations of π are approximate; guard angles near singularities.
Can SEC be negative? Yes; for example, a 120° angle produces an expected value of about −2.
Related Gnumeric functions
How this guide was checked
The official Gnumeric reference establishes the function’s purpose and argument structure. The arguments and worked examples were editorially reviewed and the stated expected results were independently calculated.
Review date: 2026-10-12. No native application run: the worked outputs are documentation-based or independently calculated expectations, not measurements from installed Gnumeric. Ordinary numeric cases and the stated text-construction examples are checked; blank/text coercion, machine extremes and workbook round trips are not certified. The formula editor in your installed version is the authority for localized separators.