TANH Function

Returns the hyperbolic tangent of a number.

Category

Math & Trig

Available in

All versions, Microsoft 365

Returns

A number from −1 to 1

Want to practice TANH in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

TANH is SINH ÷ COSH. It squashes any number into the range −1 to 1, which is why it's used in machine-learning models.

Large positive inputs approach 1, large negative approach −1.

Syntax

=TANH(number) Explain

Arguments

ArgumentRequired?What it does
numberYesAny real number.

Examples

Example 1 — Squashing values

Big inputs flatten out near ±1.

B2fx=TANH(A2)
AB
1xtanh x
200
30.50.4621
430.9951
=TANH(A2) Explain

Common mistakes

  • Not an angle. TANH doesn't use radians or degrees.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.