Math & trig function

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)
ArgumentWhat it means
numberRequiredAny 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

B4fx=B2*TANH(9.81*B3/B2)
AB
1InputValue
2Terminal velocity (m/s)55
3Time (s)3
426.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

B5fx=B2*TANH(B3/B4)
AB
1InputValue
2Max extra sales5000
3Spend2000
4Scale4000
52,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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 13 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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.

LanguageFunction name
CzechTGH
GermanTANHYP