How can I use Excel to calculate the sum of data based on specific column and row criteria?

Excel is a widely used spreadsheet program that offers a variety of functions to help users manage and analyze data. One useful feature is the ability to calculate the sum of data based on specific column and row criteria. This allows users to quickly and accurately determine the total value of a particular set of data. By selecting the desired column and row criteria, Excel can automatically add up the corresponding values and display the sum in a designated cell. This feature is particularly useful for organizing and analyzing large amounts of data, making it an essential tool for data analysis and decision making.

Excel: Sum Based on Column and Row Criteria


You can use the following syntax to sum values in Excel based on both column and row criteria:

=SUM(IF(B1:F1="Year 4",IF(A2:A9="Mavs",B2:F9)))

This particular formula calculates the sum of values in the range B2:F9 where:

  • The column value in the range B1:F1 is equal to “Year 4”
  • The row value in the range A2:A9 is equal to “Mavs”

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

Example: How to Sum Based on Column and Row Criteria in Excel

Suppose we have the following dataset in Excel that contains information about points scored by basketball players on various teams during five different years:

Suppose we would like to sum the values for the players on the Mavs team during Year 4 only.

To do so, we can type the following formula into cell H2:

=SUM(IF(B1:F1="Year 4",IF(A2:A9="Mavs",B2:F9)))

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

Excel sum based on column and row criteria

The formula tells us that players on the Mavs team during Year 4 scored a total of 62 points.

We can verify this is correct by manually identifying each of the points values for the Mavs players during Year 4:

We can calculate the sum of these values to be: 24 + 23 + 15 = 62

Note: Feel free to change “Mavs” and “Year 4” in the formula to calculate the sum of values based on different column and row criteria.

Additional Resources

The following tutorials explain how to perform other common operations in Excel:

x