To calculate the total salary for each department across four different regions, let’s take our first criterion as the department and the second criterion as the region.
The steps to calculate the total salary are,
1. Create a table that includes departments and regions by removing all the duplicate values. Your table should look like the one below.
2. Apply the SUMIFS function in the table. Open the SUMIFS function in Excel.
3. Select the sum_range as F2 to F21.
4. Select the B2 to B21 as the “criteria_range1.”
5. The “criteria” will be the “Department.” So, select the cell H2 and lock only the column.
6. The “criteria_range2” will be C2 to C21.
7. For this “criteria_range”, the criteria is “East,” so select the I1 cell as the reference and lock the only row here.
8. We now have value for the department “Web” and the region “East.”
9. Now, drag the formula to the remaining cells to have the result in all the cells.
Now, look at the detailed explanation of the formula part by part.
- Yellow Part: Yellow color is the first part of the formula that asks which column you want to sum. Our required column to sum is the salary column from F2:F21. We have locked this range (absolute reference) because this range should be standard when we copy-paste the formula to other cells.
- Green Part: It is the second part of the formula. We are considering this as our first criteria range. The first criteria we need to apply is a department column, and the department column range is B2:B21. We have locked this range (absolute reference) because this range should be standard when we copy-paste the formula to other cells.
- Grey Part: It is the extension of the Green Part. We are giving the criterion to the criteria range we have selected in the Green Part. Our criterion is in the cells from A23:A29. One interesting thing is we have locked only the column part ($H2) because when we move to the right side. The column should be standard, and when we are moving down, the row should change. For example, if we copy-paste the formula to the next cell, we should change $A23 to $A24.
- Pink Part: It is the third part of the formula. We are considering this as our second criteria range. The second criteria we must apply is the region column, and the region column range is C2:C21. We have locked this range (absolute reference) because this range should be standard when we copy-paste the formula to other cells.
- Blue Part: It is the extension of the Pink Part. We are giving the criterion to the criteria range we have selected in the Pink Part. Similar to the Grey Part of the formula.