TANH
Supported, behaves as documentedCategory: Math and trigonometry · Last tested 2026-09-01
Real compatibility results for the TANH 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
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel (desktop) | Yes | No — documented only | n/a |
| Excel for the web | — | Yes (recalc, 2026-09-01) | Supported, behaves as documented |
| Google Sheets | Yes | Yes (Drive import, 2026-08-31) | Supported, behaves as documented |
| LibreOffice Calc | Yes | Yes (25.8.7.3, 2026-08-31) | Supported, behaves as documented |
LibreOffice version history
We executed the same test cases under each LibreOffice release to show exactly when TANH’s support changed — not documentation claims, real results.
| LibreOffice version | Verdict | Tested |
|---|---|---|
| 24.2.0.3 | Supported, behaves as documented | 2026-08-31 |
| 24.8.7.2 | Supported, behaves as documented | 2026-08-31 |
| 25.2.0.3 | Supported, behaves as documented | 2026-08-31 |
| 25.8.7.3 | Supported, behaves as documented | 2026-08-31 |
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.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(TANH(-2),6) | Microsoft's first documented example, at the six decimals the Result column publishes | -0.964028 | -0.964028ProvenanceMicrosoft publishes =TANH(-2) with Result -0.964028 (its Description column rounds the same value differently, to -0.96403 -- both are the same figure at different precisions, recorded as published). DERIVATION: tanh(-2) = -0.9640275800758168839464 at 50 digits, which is -0.964028 at six places and -0.96403 at five. Microsoft's page was read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/tanh-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 |
| =TANH(0) | Microsoft's second documented row: an exact zero | 0 | 0ProvenanceMicrosoft publishes =TANH(0) = 0. tanh(0) = 0 exactly -- unlike SIN(PI()), there is no argument rounding here, so the bare value is asserted with no ROUND wrapper. |
Matched |
| =ROUND(TANH(0.5),6) | Microsoft's third documented row | 0.462117 | 0.462117ProvenanceMicrosoft publishes =TANH(0.5) = 0.462117. Derived independently as 0.4621171572600097585023, i.e. 0.462117 at the published precision. |
Matched |
| =ROUND(TANH(0.5),10) | The same example carried to ten decimals | 0.4621171573 | 0.4621171573ProvenanceAsserted at ten places from the derivation: 0.4621171573. Six published decimals cannot separate tanh from its small-argument approximation x - x^3/3, which agrees to only three places here but would still round to a plausible-looking figure at six. |
Matched |
| =ROUND(TANH(1)-SINH(1)/COSH(1),15) | tanh checked against sinh/cosh as the engine itself computes them | 0 | 0Provenancetanh(x) = sinh(x)/cosh(x) by definition -- the relation the page's own equation image states. Asserting the difference is zero makes the engine check TANH against its own SINH and COSH with no constant from us. The TANH page publishes no error-condition remarks, so no error case is asserted. |
Matched |
| =ROUND(TANH(2)+TANH(-2),15) | tanh is an odd function, so the two signs must cancel exactly | 0 | 0Provenancetanh is odd, so tanh(2) + tanh(-2) = 0 exactly. A structural assertion with no derived constant. |
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.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(TANH(-2),6) | Microsoft's first documented example, at the six decimals the Result column publishes | -0.964028 | -0.964028ProvenanceMicrosoft publishes =TANH(-2) with Result -0.964028 (its Description column rounds the same value differently, to -0.96403 -- both are the same figure at different precisions, recorded as published). DERIVATION: tanh(-2) = -0.9640275800758168839464 at 50 digits, which is -0.964028 at six places and -0.96403 at five. Microsoft's page was read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/tanh-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 |
| =TANH(0) | Microsoft's second documented row: an exact zero | 0 | 0ProvenanceMicrosoft publishes =TANH(0) = 0. tanh(0) = 0 exactly -- unlike SIN(PI()), there is no argument rounding here, so the bare value is asserted with no ROUND wrapper. |
Matched |
| =ROUND(TANH(0.5),6) | Microsoft's third documented row | 0.462117 | 0.462117ProvenanceMicrosoft publishes =TANH(0.5) = 0.462117. Derived independently as 0.4621171572600097585023, i.e. 0.462117 at the published precision. |
Matched |
| =ROUND(TANH(0.5),10) | The same example carried to ten decimals | 0.4621171573 | 0.4621171573ProvenanceAsserted at ten places from the derivation: 0.4621171573. Six published decimals cannot separate tanh from its small-argument approximation x - x^3/3, which agrees to only three places here but would still round to a plausible-looking figure at six. |
Matched |
| =ROUND(TANH(1)-SINH(1)/COSH(1),15) | tanh checked against sinh/cosh as the engine itself computes them | 0 | 0Provenancetanh(x) = sinh(x)/cosh(x) by definition -- the relation the page's own equation image states. Asserting the difference is zero makes the engine check TANH against its own SINH and COSH with no constant from us. The TANH page publishes no error-condition remarks, so no error case is asserted. |
Matched |
| =ROUND(TANH(2)+TANH(-2),15) | tanh is an odd function, so the two signs must cancel exactly | 0 | 0Provenancetanh is odd, so tanh(2) + tanh(-2) = 0 exactly. A structural assertion with no derived constant. |
Matched |
LibreOffice Calc 25.8.7.3 (tested 2026-08-31)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(TANH(-2),6) | Microsoft's first documented example, at the six decimals the Result column publishes | -0.964028 | -0.964028ProvenanceMicrosoft publishes =TANH(-2) with Result -0.964028 (its Description column rounds the same value differently, to -0.96403 -- both are the same figure at different precisions, recorded as published). DERIVATION: tanh(-2) = -0.9640275800758168839464 at 50 digits, which is -0.964028 at six places and -0.96403 at five. Microsoft's page was read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/tanh-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 |
| =TANH(0) | Microsoft's second documented row: an exact zero | 0 | 0ProvenanceMicrosoft publishes =TANH(0) = 0. tanh(0) = 0 exactly -- unlike SIN(PI()), there is no argument rounding here, so the bare value is asserted with no ROUND wrapper. |
Matched |
| =ROUND(TANH(0.5),6) | Microsoft's third documented row | 0.462117 | 0.462117ProvenanceMicrosoft publishes =TANH(0.5) = 0.462117. Derived independently as 0.4621171572600097585023, i.e. 0.462117 at the published precision. |
Matched |
| =ROUND(TANH(0.5),10) | The same example carried to ten decimals | 0.4621171573 | 0.4621171573ProvenanceAsserted at ten places from the derivation: 0.4621171573. Six published decimals cannot separate tanh from its small-argument approximation x - x^3/3, which agrees to only three places here but would still round to a plausible-looking figure at six. |
Matched |
| =ROUND(TANH(1)-SINH(1)/COSH(1),15) | tanh checked against sinh/cosh as the engine itself computes them | 0 | 0Provenancetanh(x) = sinh(x)/cosh(x) by definition -- the relation the page's own equation image states. Asserting the difference is zero makes the engine check TANH against its own SINH and COSH with no constant from us. The TANH page publishes no error-condition remarks, so no error case is asserted. |
Matched |
| =ROUND(TANH(2)+TANH(-2),15) | tanh is an odd function, so the two signs must cancel exactly | 0 | 0Provenancetanh is odd, so tanh(2) + tanh(-2) = 0 exactly. A structural assertion with no derived constant. |
Matched |
Docs & syntax
- Excel (desktop): official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation