← All functions

SEC

Quirk found

Category: Math and trigonometry · Last tested 2026-09-01

Real compatibility results for the SEC function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.

Support matrix

EngineDocumentedLive-testedVerdict
Excel (desktop)Yes No — documented only n/a
Excel for the web— Yes (recalc, 2026-09-01) Supported, behaves as documented
Google SheetsYes Yes (Drive import, 2026-08-31) Supported, behaves as documented
LibreOffice CalcYes Yes (25.8.7.3, 2026-08-31) Quirk found

LibreOffice version history

We executed the same test cases under each LibreOffice release to show exactly when SEC’s support changed — not documentation claims, real results.

LibreOffice versionVerdictTested
24.2.0.3 Quirk found 2026-08-31
24.8.7.2 Quirk found 2026-08-31
25.2.0.3 Quirk found 2026-08-31
25.8.7.3 Quirk found 2026-08-31

Why isn't SEC working in LibreOffice?

SEC exists in LibreOffice 25.8.7.3, but it is not a drop-in match for Excel — our executed tests found real behavioral differences (detailed in the test results on this page). If a formula that works in Excel or Google Sheets misbehaves in LibreOffice, compare your usage against the failing cases above before assuming your data is wrong.

Discovered quirks

Executed test cases

Excel for the web (executed 2026-09-01 via OneDrive recalculation)

These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.

FormulaDescriptionResultExpectedVerdict
=ROUND(SEC(45),5) Microsoft's first documented example, at the five decimals it publishes 1.90359 1.90359
Provenance

Microsoft publishes =SEC(45) = 1.90359. DERIVATION: SEC is 1/COS, and the argument is in RADIANS, so this is 1/cos(45 rad) = 1.9035944074044247389 at 50 digits (mpmath), which is 1.90359 at the published precision. THE PAGE'S OWN DESCRIPTION IS WRONG ABOUT THE UNIT: it reads "Returns the secant of a 45 degree angle", but 45 DEGREES would give 1/cos(pi/4) = 1.4142135624, not the 1.90359 the same row publishes. The page's Remarks bullet contradicts its own description and is the correct half -- "If you want to supply the angle in degrees, multiply the angle by PI()/180 or use the RADIANS function" -- so the published RESULT is right and the word "degree" in the description is the error. Microsoft's page was read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/sec-function. FETCH NOTE FOR THIS BATCH: batch F recorded every /en-us/office/<name>-function-<guid> URL returning Microsoft's 'Sorry, the page you're looking for can't be found' body; today BOTH paths serve the article again -- the GUID form redirects to /en-us/excel/functions/<slug>-function -- and every page cited in this batch came back complete (217-223 KB) in one or two attempts, with no 87 KB stub responses. Nothing here is sourced from a search snippet or a mirror.

Matched
=ROUND(SEC(30),5) Microsoft's second documented example 6.48292 6.48292
Provenance

Microsoft publishes =SEC(30) = 6.48292. Derived independently as 1/cos(30 rad) = 6.482921234962677788 at 50 digits, i.e. 6.48292 at the published precision. Same description/unit error as the 45 row: 30 DEGREES would give 1/cos(pi/6) = 1.1547005384.

Matched
=ROUND(SEC(45),10) The same example carried to ten decimals, where a unit or reciprocal error cannot hide 1.9035944074 1.9035944074
Provenance

Five published decimals cannot separate an engine that computes 1/COS from one that computes COS of a reciprocal, or one that silently converts units. Asserted at ten places from the independent derivation: 1.9035944074.

Matched
=ROUND(SEC(45*PI()/180),10) The page's own documented degrees-to-radians conversion, which must give the secant of a true 45 degrees 1.4142135624 1.4142135624
Provenance

The Remarks bullet says to convert degrees with PI()/180. A true 45-degree secant is 1/cos(pi/4) = sqrt(2) = 1.41421356237309504880, i.e. 1.4142135624 at ten places -- a structural assertion with no derived constant, since sec(45 deg) is exactly sqrt(2). It is also the value the page's own "45 degree angle" description would require, which is how the description was shown to be wrong.

Matched
=SEC("abc") A non-numeric argument, which the page assigns an error code #VALUE! #VALUE!
Provenance

The Remarks publish: "If number is a nonnumeric value, SEC returns the #VALUE! error values." (the trailing plural is Microsoft's, recorded as published).

Matched
=SEC(200000000) An argument beyond the documented magnitude limit #NUM! #NUM!
Provenance

The Remarks publish: "The absolute value of number must be less than 2^27" and "If number is outside its constraints, SEC returns the #NUM! error value." 2^27 = 134217728, so 200000000 is outside the documented range. LIBREOFFICE DOES NOT ENFORCE THE LIMIT: all four builds returned -1.35887556717362 rather than #NUM!. That is a silent wrong answer rather than a harmless permissiveness, and the limit exists precisely because of it -- at 2e8 radians the argument reduction consumes every bit of a double's precision, so the secant returned is numerically meaningless. Excel documents the guard; LibreOffice computes through it.

Matched

Google Sheets (executed 2026-08-31 via Drive import)

Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.

FormulaDescriptionResultExpectedVerdict
=ROUND(SEC(45),5) Microsoft's first documented example, at the five decimals it publishes 1.90359 1.90359
Provenance

Microsoft publishes =SEC(45) = 1.90359. DERIVATION: SEC is 1/COS, and the argument is in RADIANS, so this is 1/cos(45 rad) = 1.9035944074044247389 at 50 digits (mpmath), which is 1.90359 at the published precision. THE PAGE'S OWN DESCRIPTION IS WRONG ABOUT THE UNIT: it reads "Returns the secant of a 45 degree angle", but 45 DEGREES would give 1/cos(pi/4) = 1.4142135624, not the 1.90359 the same row publishes. The page's Remarks bullet contradicts its own description and is the correct half -- "If you want to supply the angle in degrees, multiply the angle by PI()/180 or use the RADIANS function" -- so the published RESULT is right and the word "degree" in the description is the error. Microsoft's page was read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/sec-function. FETCH NOTE FOR THIS BATCH: batch F recorded every /en-us/office/<name>-function-<guid> URL returning Microsoft's 'Sorry, the page you're looking for can't be found' body; today BOTH paths serve the article again -- the GUID form redirects to /en-us/excel/functions/<slug>-function -- and every page cited in this batch came back complete (217-223 KB) in one or two attempts, with no 87 KB stub responses. Nothing here is sourced from a search snippet or a mirror.

Matched
=ROUND(SEC(30),5) Microsoft's second documented example 6.48292 6.48292
Provenance

Microsoft publishes =SEC(30) = 6.48292. Derived independently as 1/cos(30 rad) = 6.482921234962677788 at 50 digits, i.e. 6.48292 at the published precision. Same description/unit error as the 45 row: 30 DEGREES would give 1/cos(pi/6) = 1.1547005384.

Matched
=ROUND(SEC(45),10) The same example carried to ten decimals, where a unit or reciprocal error cannot hide 1.903594407 1.9035944074
Provenance

Five published decimals cannot separate an engine that computes 1/COS from one that computes COS of a reciprocal, or one that silently converts units. Asserted at ten places from the independent derivation: 1.9035944074.

Matched
=ROUND(SEC(45*PI()/180),10) The page's own documented degrees-to-radians conversion, which must give the secant of a true 45 degrees 1.414213562 1.4142135624
Provenance

The Remarks bullet says to convert degrees with PI()/180. A true 45-degree secant is 1/cos(pi/4) = sqrt(2) = 1.41421356237309504880, i.e. 1.4142135624 at ten places -- a structural assertion with no derived constant, since sec(45 deg) is exactly sqrt(2). It is also the value the page's own "45 degree angle" description would require, which is how the description was shown to be wrong.

Matched
=SEC("abc") A non-numeric argument, which the page assigns an error code #VALUE! #VALUE!
Provenance

The Remarks publish: "If number is a nonnumeric value, SEC returns the #VALUE! error values." (the trailing plural is Microsoft's, recorded as published).

Matched
=SEC(200000000) An argument beyond the documented magnitude limit #NUM! #NUM!
Provenance

The Remarks publish: "The absolute value of number must be less than 2^27" and "If number is outside its constraints, SEC returns the #NUM! error value." 2^27 = 134217728, so 200000000 is outside the documented range. LIBREOFFICE DOES NOT ENFORCE THE LIMIT: all four builds returned -1.35887556717362 rather than #NUM!. That is a silent wrong answer rather than a harmless permissiveness, and the limit exists precisely because of it -- at 2e8 radians the argument reduction consumes every bit of a double's precision, so the secant returned is numerically meaningless. Excel documents the guard; LibreOffice computes through it.

Matched

LibreOffice Calc 25.8.7.3 (tested 2026-08-31)

FormulaDescriptionResultExpectedVerdict
=ROUND(SEC(45),5) Microsoft's first documented example, at the five decimals it publishes 1.90359 1.90359
Provenance

Microsoft publishes =SEC(45) = 1.90359. DERIVATION: SEC is 1/COS, and the argument is in RADIANS, so this is 1/cos(45 rad) = 1.9035944074044247389 at 50 digits (mpmath), which is 1.90359 at the published precision. THE PAGE'S OWN DESCRIPTION IS WRONG ABOUT THE UNIT: it reads "Returns the secant of a 45 degree angle", but 45 DEGREES would give 1/cos(pi/4) = 1.4142135624, not the 1.90359 the same row publishes. The page's Remarks bullet contradicts its own description and is the correct half -- "If you want to supply the angle in degrees, multiply the angle by PI()/180 or use the RADIANS function" -- so the published RESULT is right and the word "degree" in the description is the error. Microsoft's page was read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/sec-function. FETCH NOTE FOR THIS BATCH: batch F recorded every /en-us/office/<name>-function-<guid> URL returning Microsoft's 'Sorry, the page you're looking for can't be found' body; today BOTH paths serve the article again -- the GUID form redirects to /en-us/excel/functions/<slug>-function -- and every page cited in this batch came back complete (217-223 KB) in one or two attempts, with no 87 KB stub responses. Nothing here is sourced from a search snippet or a mirror.

Matched
=ROUND(SEC(30),5) Microsoft's second documented example 6.48292 6.48292
Provenance

Microsoft publishes =SEC(30) = 6.48292. Derived independently as 1/cos(30 rad) = 6.482921234962677788 at 50 digits, i.e. 6.48292 at the published precision. Same description/unit error as the 45 row: 30 DEGREES would give 1/cos(pi/6) = 1.1547005384.

Matched
=ROUND(SEC(45),10) The same example carried to ten decimals, where a unit or reciprocal error cannot hide 1.9035944074 1.9035944074
Provenance

Five published decimals cannot separate an engine that computes 1/COS from one that computes COS of a reciprocal, or one that silently converts units. Asserted at ten places from the independent derivation: 1.9035944074.

Matched
=ROUND(SEC(45*PI()/180),10) The page's own documented degrees-to-radians conversion, which must give the secant of a true 45 degrees 1.4142135624 1.4142135624
Provenance

The Remarks bullet says to convert degrees with PI()/180. A true 45-degree secant is 1/cos(pi/4) = sqrt(2) = 1.41421356237309504880, i.e. 1.4142135624 at ten places -- a structural assertion with no derived constant, since sec(45 deg) is exactly sqrt(2). It is also the value the page's own "45 degree angle" description would require, which is how the description was shown to be wrong.

Matched
=SEC("abc") A non-numeric argument, which the page assigns an error code #VALUE! #VALUE!
Provenance

The Remarks publish: "If number is a nonnumeric value, SEC returns the #VALUE! error values." (the trailing plural is Microsoft's, recorded as published).

Matched
=SEC(200000000) An argument beyond the documented magnitude limit -1.35887556717362 #NUM!
Provenance

The Remarks publish: "The absolute value of number must be less than 2^27" and "If number is outside its constraints, SEC returns the #NUM! error value." 2^27 = 134217728, so 200000000 is outside the documented range. LIBREOFFICE DOES NOT ENFORCE THE LIMIT: all four builds returned -1.35887556717362 rather than #NUM!. That is a silent wrong answer rather than a harmless permissiveness, and the limit exists precisely because of it -- at 2e8 radians the argument reduction consumes every bit of a double's precision, so the secant returned is numerically meaningless. Excel documents the guard; LibreOffice computes through it.

Mismatch

Docs & syntax

Where SEC behaves differently