top of page

You are learning SUM in MS Excel

SUM function with non-numeric data (error handling)?

The SUM function in Excel encounters errors when it tries to add non-numeric data. Here are two common approaches to handle this:

1. Using IF function and SUMPRODUCT:

This method combines the IF function and SUMPRODUCT to selectively add only numeric values.

- Formula: `=SUMPRODUCT(--(ISNUMBER(A1:A10))*A1:A10)`

Explanation:

- `ISNUMBER(A1:A10)`: Checks each cell in the range A1:A10 for numeric values. It returns TRUE for numbers and FALSE for text or other non-numeric data.
- `--`: This double negative sign converts the TRUE/FALSE results from ISNUMBER to 1/0. Numbers are treated as 1 for addition, while text becomes 0 and is effectively ignored by SUMPRODUCT.
- `SUMPRODUCT`: Multiplies the corresponding elements from the converted ISNUMBER results and the original range (A1:A10) and then adds them up. This effectively sums only the numeric values in the range.

2. Using SUMIFS function (Excel 2016 and later):

This method utilizes the SUMIFS function, which allows you to sum based on multiple criteria, including checking for numeric data.

- Formula: `=SUMIFS(A1:A10, A1:A10, ">=" & 0)`

Explanation:

- `A1:A10`: The range of cells containing your data.
- `A1:A10`: This is used twice. The first checks the corresponding cells for the criteria.
- `">=" & 0`: This criteria essentially checks if the cell value is greater than or equal to zero. Since text cannot be greater than or equal to zero numerically, it excludes them from the summation.

Both methods achieve the same goal of summing only the numeric values while ignoring non-numeric data in the specified range. Choose the method that best suits your Excel version and preference.

bottom of page