Calculate the sum of individual categories in microsoft excel

I am trying to work on a Accounting finance sheet for budgeting. I am stuck here. I want to calculate the sum of individual categories in "Actual Expenses" column. For example - The sum of "Fixed Expenses" from the range B15:B19 has to be in I3 cell. The sum of "Travel" category from the range B15:B19 has to be in the I4 cell. Could anyone help me out with the formula here?

enter image description here


Solution 1:

Use the SUMIF function. On cell J3, enter the following formula:

=SUMIF($B$15:$B$19,"=" & I2,$C$15:$C$19)

Drag the formula down to fill the other cells.

Solution 2:

You may try this also:

  • Formula in cell J3:

    =SUMPRODUCT(--($B$15:$B$19=$I3),$C$15:$C$19)

  • Adjust the cell references as needed.