Adding Values in One Column for Multiple Conditions
If you ever needed the SUM of values in a one column that contains multiple criteria, in this Excel tutorial I will show an example of formulas how can we sum up of values from one column to multiple criteria. If you look at the picture below the situation is the following. In columns 'B' and 'D' you can see the text that we want the sum of values from one column and these are columns 'C' and 'E'. Also note that in columns 'B' and 'D', duplicate text is found. Our task is the sum of values for the terms 'letter A' and 'letter M'.
Use the formula below for the sum of values with multiple conditions in one column. Note that the criteria or conditions are defined in the formula itself.
To sum the values from column 'C' (Header2) for the two letter 'A and M' then we can use the formula.
To make the sum of the values in column 'E' (Header4) for the two letter 'A and M' then we can use the formula.
Sum of values for single columns with multiple conditions
If we want to find unique text data from two columns and add values from one column then we can do this in the following way.
In the 'G' column below, you can see unique data from two columns below. This data can be obtained from columns 'B and D' by the following formula below the image.
Return Unique Text if there are Duplicates in Two Columns
The array formula shown below is in cell 'G3' and it is next. (This formula will return 'A and M' to two unique letters because they are repeated in both 'B' and 'D' columns).
Next formula in 'H3' cell
This formula will return the value from the same row for condition in 'G3' cell. Copy a formula down.
In 'H8' cell we have a simple formula for summation (SUM)
The formula in 'G13' cell is as follows: (Another formula that is related to cell range 'G3:G7')
Sum of Values for Multiple Conditions from One Column
If you define the conditions in certain cells (in this case, in the picture below, there are 'J3' and 'M3' cells, then you can use the formula below the picture (All the formulas below show the same result).
The formula in 'L5' cell is the following:
The formula in 'L7' cell is the following:
The formula in 'L9' cell is the following:
The formula in 'L11' cell is the following:
The formula in 'L15' cell is the following:
The formula in 'L17' cell is the following: (here, please note that this formula has three conditions, the third condition is 'Header2' in 'L2' cell.
Sum of Values for Unique from Duplicate Data with Criterion <>0
In case you have a situation when you want to set a condition or criterion then you can use the auxiliary columns as shown below.
In the column 'F' in the image above, you find the auxiliary data for the 'Header1' column. In the column "G" in the image above you will find the auxiliary data for the 'Header3' column. Note that there is no 'A' in the column 'F'. If you're wondering why? Because the value for that data in column 'B' = 0 is the condition we set in the formula.
The formula in 'F2' cell is the following:
The formula in 'G2' cell is the following:
In column 'H', unique data for duplicates from columns 'A' and 'C' are extracted but only those that do not have the corresponding zero value '0'.
ARRAY CSE Formula in 'H2' cell is the following:
And finally the Array CSE formula in 'H8' cell is the following:
If you want to avoid helper columns then using the following ARRAY formula (published by Andrej)
Please note when using the SUMPRODUCT Excel function. If you have lots of rows and data or if you have a lot of formulas that contain the Sumproduct function, then it can slow you down when calculating Excel.
Pay attention, you may need as a delimiter of arguments formula use a comma (,) instead of a semicolon (;).
Copy formula to Notepad and with Find/Replace change semicolon to comma.