How to Calculate Gini Coefficient in Excel (With Example)

The Gini coefficient can be calculated in Excel using a formula called LINEST, which stands for “linear estimation”. This formula requires a table of data that is sorted in ascending order and contains the cumulative percentages of the population along with the cumulative share of the population’s income. Once these two values are entered, the formula can be applied to calculate the Gini coefficient. An example of this can be seen by examining a table of data on the cumulative percentage of the population and their cumulative share of the income. By entering the data into the LINEST formula, the Gini coefficient can be calculated.


Named after Italian statistician , the Gini coefficient is a way to measure the income distribution of a population.

The value for the Gini coefficient ranges from 0 to 1 where higher values represent greater income inequality and where:

  • 0 represents perfect income equality (everyone has the same income)
  • 1 represents perfect income inequality (one individual has all the income)

You can find a list of Gini coefficients by country .

The following step-by-step example shows how to calculate a Gini coefficient in Excel.

Step 1: Enter the Data

First, we must enter values for two columns: the cumulative population % and cumulative income % of individuals in a certain country:

Here’s how to interpret the values:

  • The bottom 20% of individuals in this country account for 10% of the total income.
  • The bottom 50% of individuals in this country account for 31% of the total income.
  • The bottom 60% of individuals in this country account for 40% of the total income.
  • 100% of individuals in this country account for 100% of the total income.

Step 2: Calculate Areas Under Lorenz Curve

Next, we need to calculate the individual areas under the , which is a curve we use to visualize the distribution of income in a country. 

In our example, we’ll type the following formula in cell C3:

=(A3-A2)*(B3+B2)*0.5

We’ll then copy and paste this formula down to every remaining cell in column C:

Step 3: Calculate Gini Coefficient

=1-2*SUM(C3:C6)

The following screenshot shows how to use this formula in practice:

Gini coefficient in Excel

The Gini coefficient for this population turns out to be 0.226.

This is an extremely simple example of how to calculate a Gini coefficient but you can use these exact same formulas to calculate a Gini coefficient for a much larger dataset.

x