Excel - Sum column if condition is met by checking other column in same table

后端 未结 3 1734
猫巷女王i
猫巷女王i 2020-12-29 20:18

I am trying to create spreadsheet to use in a small retail shop.

I have a workbook which contains expenses figures on a sheet and income figure on another sheet.

3条回答
  •  無奈伤痛
    2020-12-29 20:52

    This should work, but there is a little trick. After you enter the formula, you need to hold down Ctrl+Shift while you press Enter. When you do, you'll see that the formula bar has curly-braces around your formula. This is called an array formula.

    For example, if the Months are in cells A2:A100 and the amounts are in cells B2:B100, your formula would look like {=SUM(If(A2:A100="January",B2:B100))}. You don't actually type the curly-braces though.

    You could also do something like =SUM((A2:A100="January")*B2:B100). You'd still need to use the trick to get it to work correctly.

提交回复
热议问题