TANH function
Returns the hyperbolic tangent of a number: a smooth S-curve between −1 and 1.
Available in All versions of Excel, Excel for the web, Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
TANH(number)| Argument | What it means | |
|---|---|---|
number | Required | Any real number. |
Returns: A value between −1 and 1.
How TANH works
TANH is SINH divided by COSH and produces a smooth S-shaped curve that starts at −1, passes through 0 and levels off at 1. That shape describes anything that saturates: the speed of a falling object approaching terminal velocity, a marketing response that flattens as spend increases, or the activation function in a neural network.
Because the output is bounded, TANH is safe with any input and never overflows: large positive numbers return 1 and large negative numbers −1. The inverse is ATANH.
Examples
1Speed of a skydiver after 3 seconds
| A | B | |
|---|---|---|
| 1 | Input | Value |
| 2 | Terminal velocity (m/s) | 55 |
| 3 | Time (s) | 3 |
| 4 | 26.9 |
Result: 26.9
With air resistance, speed is vₜ·tanh(g·t/vₜ) ≈ 26.9 m/s after 3 s (1 decimal), well below the 29.4 m/s of free fall.
2Saturating response to ad spend
| A | B | |
|---|---|---|
| 1 | Input | Value |
| 2 | Max extra sales | 5000 |
| 3 | Spend | 2000 |
| 4 | Scale | 4000 |
| 5 | 2,311 |
Result: 2,311
A 2,000 spend yields about 2,311 extra sales (rounded); doubling the spend would add less, because the curve flattens.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | Non-numeric argument. | Check the input. |
Tips
- TANH(x) = 2·LOGISTIC(2x) − 1, so it is a stretched version of the logistic curve.
Google Sheets
TANH also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
TANH in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.