How to Calculate a Sigmoid Function in Excel

The sigmoid function is a mathematical function which can be used to map any given value to a value between 0 and 1. This can be done in Excel by entering the formula =1/(1+e^(-x)) into a cell, where x is the value that you want to map. This will output the mapped value between 0 and 1.


A is a mathematical function that has an “S” shaped curve when plotted.

The most common example of a sigmoid function is the logistic sigmoid function, which is calculated as:

F(x) = 1 / (1 + e-x)

To calculate the value of a sigmoid function for a given x value in Excel, we can use the following formula:

=1/(1+EXP(-A1))

This formula assumes the x value is located in cell A1.

The following example shows how to use this formula in practice.

Example: Calculate Sigmoid Function in Excel

Suppose we have the following list of x values in a column in Excel:

To calculate the value of the sigmoid function for each x value, I can type the following formula into cell B2:

=1/(1+EXP(-A2))

I can then drag this formula down to every remaining cell in column B to calculate the value of the sigmoid function for each x value:

sigmoid function in Excel

We can then create a line plot to visualize the values of the sigmoid function.

First, highlight every value in column A and B:

Once you click this, the following line chart will appear:

The x-axis displays the x values and the y-axis displays the value of the sigmoid function for each x value.

Notice that the plot exhibits the “S” shaped curve that is characteristic of a sigmoid function.

x