Math & Trig

TANH Function in Excel

Returns the hyperbolic tangent of a number.

Syntax

  • =TANH(number)

Arguments

  • number (required): Any real number

Examples

  • =TANH(1) - Hyperbolic tangent of 1 - Result: 0.762

TANH in reporting workflows

  • Use absolute references when copying formulas across rows.
  • For conditional totals see [SUMIF](/functions/sumif/) and [SUMIFS](/functions/sumifs/).
  • Filtered lists may need [SUBTOTAL](/functions/subtotal/) instead of SUM on visible cells only.

Common errors

  • Result always between -1 and 1

Use cases

  • Neural networks
  • Engineering
  • Physics

Frequently asked questions

  • What is TANH (hyperbolic tangent)? TANH = SINH/COSH = (e^x - e^-x)/(e^x + e^-x). It's an S-shaped curve (sigmoid) that smoothly transitions from -1 to +1. TANH(0)=0, and the function approaches ±1 as x approaches ±infinity.
  • Why is TANH used in neural networks? TANH is a popular activation function because: output is centered at 0 (unlike sigmoid), gradients are stronger than sigmoid, and it squashes values to [-1,1] range. It helps neural networks learn non-linear patterns.
  • What is the difference between TANH and sigmoid? Sigmoid outputs 0 to 1; TANH outputs -1 to 1. TANH is zero-centered which often helps training. TANH = 2*sigmoid(2x) - 1. Both are S-shaped but TANH has steeper gradients near zero.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.