SEC
Returns the secant of an angle, defined as 1 / COS(angle).
Use SEC for reciprocal-cosine calculations in radian-based formulas.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=SEC(number)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
number | number | Required | — |
How it works
Secant is 1 / cos(x) for a radian angle x. Its poles are π/2 plus integer multiples of π.
Differences from Excel
At PI()/2, Formualizer reports #DIV/0! and Excel returns a finite approximation of about 1.63312E+16.
Remarks
- Domain: valid for all real angles except where
COS(angle) = 0. - Radians: input is interpreted in radians.
Error cases
- Errors: returns
#DIV/0!near odd multiples ofPI()/2.
Examples
Invert the cosine of half a radian.
Formula =SEC(0.5)
Expected result 1.13949392732455
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Opposite angles have the same secant because cosine is even.
Formula =SEC(-0.5)
Expected result 1.13949392732455
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
At zero radians, the reciprocal of cosine is one.
Formula =SEC(0)
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The text “invalid” cannot be used as the input to the secant.
Formula =SEC("invalid")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
When does SEC return #DIV/0!?
SEC returns #DIV/0! when COS(angle) is effectively zero.