Practice free

TANH function

TANH returns the hyperbolic tangent of a number, a value between -1 and 1. It is seen in machine-learning style squashing curves and other technical work.

Example

Practice this in the app

Syntax

TANH(number)

number (required)
Any number or a reference to one.

Returns: The hyperbolic tangent, between -1 and 1.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=TANH(0.5) 0.462117157 Positive
=TANH(0) 0 Zero
=TANH(-0.5) -0.462117157 Negative
=TANH(2) 0.96402758 Larger value
=TANH("0.5") 0.462117157 Text number "0.5"
=TANH(TRUE) 0.761594156 TRUE
=TANH("abc") #VALUE! Non-numeric text
=TANH(Data!E4) #DIV/0! Error cell propagates

The Data sheet these formulas read

A cell that starts with = holds that formula.

Where it works

Excel
TANH is in every version of Excel from 2007 on.
Google Sheets
Same name, same behaviour for everyday use.

Part of Math and trig functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .