TANH in Google Sheets: Create a Bounded Signed Transformation
Use Sheets hyperbolic tangent with scaled models, sign controls, inverse reconstruction and saturation limits.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: TANH returns the hyperbolic tangent of a real number. =TANH(0.5) is expected to give approximately 0.462117157, while a zero input gives 0.
Availability and version history
- Introduced: original service launch date is not established by the official history reviewed; Sheets has no corresponding numbered desktop release in this guide.
- Availability: documented in the rolling Google Sheets service; examples use an ordinary web spreadsheet and numeric cells.
- Checked: October 14, 2026; official TANH reference. Documentation and independent calculations, without native Sheets execution or broader client certification.
Syntax and mathematical bounds
=TANH(value)
Google specifies a real input. Mathematically TANH(x)=SINH(x)/COSH(x), with an ideal finite-real result strictly between −1 and 1. It is a signed hyperbolic ratio, not the circular tangent of a degree angle.
A stored or displayed result can nevertheless round to an endpoint for sufficiently large input. The strict mathematical bounds do not certify every floating-point representation. This guide does not infer a native saturation threshold.
The real-valued scope applies to this function. It does not mean Sheets lacks separate functions for complex-number calculations, despite broad wording in the short help note.
Example 1: inspect sign and compression
Enter −1.5, −0.5, 0, 0.5, 1.5 in A2:A6. In B2 enter =TANH(A2) and fill down. Expected results, approximately:
| Input | TANH |
|---|---|
| −1.5 | −0.905148254 |
| −0.5 | −0.462117157 |
| 0 | 0 |
| 0.5 | 0.462117157 |
| 1.5 | 0.905148254 |
Opposite inputs give opposite outputs. Tripling 0.5 to 1.5 does not triple the response; the transform becomes flatter toward its bounds. Keep the original inputs when reporting transformed data.
Example 2: verify the related functions
=SINH(0.5)/COSH(0.5)
=TANH(0.5)
Both expected results are approximately 0.462117157. The SINH and COSH names matter; replacing them with SIN and COS changes the calculation to circular tangent.
An exponential identity is (EXP(2*x)-1)/(EXP(2*x)+1). At x=0.5 it gives the same ordinary mathematical result. That does not prove identical native overflow or cancellation behavior for an expanded expression at every magnitude.
Advanced example: separate maximum response from input scale
Suppose a fictional model is defined as y=20*TANH(x/4). Enter x values −8, −4, 0, 4, 8 in D2:D6. In E2 enter and fill down:
=20*TANH(D2/4)
Expected outputs are approximately −19.280551602, −15.231883119, 0, 15.231883119, 19.280551602. The multiplier sets the response scale of 20, while the divisor controls how quickly the input reaches a flatter part of the curve.
Keep compatible units in the ratio x/4 and label the transformed output. This selected model is a demonstration, not a recommendation for an unspecified measured process. It does not turn all large source values into interchangeable original observations just because their displayed responses are close.
Advanced example: reconstruct an ordinary target
For a target ratio r strictly between −1 and 1, the inverse mathematical expression is 0.5*LN((1+r)/(1-r)). At r=0.5:
=0.5*LN((1+0.5)/(1-0.5))
Expected input: approximately 0.549306144. Applying TANH to the unrounded result reconstructs approximately 0.5. LN is the natural logarithm.
The inverse excludes endpoint ratios of ±1. If a forward output was rounded to an endpoint, the stored value no longer retains an ordinary finite inverse. Do not conceal that information loss by replacing one with an arbitrary nearby fraction.
Troubleshooting
Check whether the source is a real model argument, a percentage stored on the wrong scale or an angle intended for TAN. Do not insert a degrees-to-radians conversion merely because the name includes tangent.
Use zero and both signs of a moderate input as controls, and retain full intermediate precision. Native extreme-value behavior, imported text coercion and every error display remain outside the independent numerical tests reported here.
References and verification
Worked inputs are fictional and outputs independently calculated. Approximate values are rounded mathematical expectations, not captured native results. Imported types, extreme magnitudes and a complete error/coercion matrix remain outside the tests.