Use SUMIF function in Excel to get the subtotal of all invoices one by one. In our example, we will perform the task stepwise:
1- Go to a blank cell where you want subtotal of the particular invoice. (e.g. cell E6 in below-mentioned screenshot)
2- For SUMIF function, type “=SUMIF(“ and select range of cells from A2 to A10.
Note: in the SUMIF function, range means the range of cells that we want to be evaluated against criteria.
3- Select criteria “12” because we want total against all 12 number invoices.
4. Select actual cells to add against selected criteria of “12”.
5. After pressing Enter button, Excel will subtotal all 12 number invoices.
Now for invoice number 14, first stagnant A2:A10 and B2:B10 range by selecting the range one by one in the formula and,
and press F4 button.
Now copy and paste the formula to cell E7 and change criteria from “12” to “14”.
After pressing Enter button, Excel will subtotal all invoices of 14.