Having issue with SUMIFS()

DeGeorge

New Member
Joined
Jan 29, 2024
Messages
12
Office Version
  1. 365
Platform
  1. Windows
I'm trying to sum a range based on multiple other columns.

I want to sum C3:C41 if G3:G41 = "Payment" and Month of B3:B41 = "4" and Year of B3:B41 = "2019"

So I tried this =SUMIFS(C3:C41,G3:G41,"Payment",Month(B3:B41),"4",Year(B3:B41),"2019"), and it won't resolve.

Separately, Month(B3:B41) returns an array of the months of the dates in that range. Year(B3:B41) returns an array of years of the dates in that range. When I add the criteria for month or year, I get TRUE or FALSE but it only works on 1 cell at at time, not a range. I get a spill range.

I'm guessing that Month() and Year() can't be used as criteria in a SUMIFS because of the spill?

Any ideas? Thanks!
 
Fluff & Alex

Both solutions worked, however Fluff's solution is a little easier to manipulate. Thank you both for your help with this! I really appreciate it.
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Fluff and Alex

Both solutions worked, however Fluff's solution is a little easier to manipulate. Thank you both for your help with this! I really appreciate it.
 
Upvote 0
I would like ONE formula for the column that I can copy down HUNDREDS of rows
Would an option where you didn't need to copy anywhere, just put in the top row be worth considering?
DeGeorge.xlsm
BCD
1DateAmountComments
21/04/2019($25.71)Payment
31/04/2019($7.99)Payment
43/04/2019($241.92)Payment
53/04/2019$150.00Deposit
65/04/2019$107.00Deposit
75/04/2019$11.99Deposit
88/04/2019($53.40)Payment
98/04/2019($9.59)Payment
109/04/2019($34.33)Payment
112/05/2019($45.00)Payment
122/05/2019$25.00Deposit
132/05/2019($12.22)Payment
142/05/2019$35.00Deposit
1517/05/2019($6.93)Payment
1620/05/2019($79.73)Payment
1721/05/2019$6,336.00Deposit
1811/12/2023($200.32)Payment
1922/05/2019($118.01)Payment
2028/05/2019($2.90)Payment
2130/05/2019$436.00Deposit
2230/05/2019($19.37)Payment
2331/05/2019$0.28Deposit
243/06/2019($76.15)Payment
253/06/2019$364.00Deposit
263/06/2019($31.74)Payment
274/06/2019($47.50)Payment
285/06/2019($95.00)Payment
295/06/2019$765.00Deposit
305/06/2019($28.50)Payment
3110/06/2019($108.16)Payment
3210/06/2019$679.00Deposit
3310/06/2019($26.80)Payment
3410/06/2019$345.00Deposit
3510/06/2019($19.99)Payment
3610/06/2019($12.79)Payment
3710/06/2019($12.78)Payment
3810/06/2019$234.00Deposit
391/03/2023($100.16)Payment
4012/06/2019$234.00Deposit
4112/06/2019$243.00Deposit
4213/06/2019($4.66)Payment
Sheet1


DeGeorge.xlsm
ABC
1MonthPaymentsDeposits
2Apr-19($372.94)$268.99
3May-19($284.16)$6,832.28
4Jun-19($464.07)$2,864.00
5Jul-19$0.00$0.00
6Aug-19$0.00$0.00
7Sep-19$0.00$0.00
Sheet2
Cell Formulas
RangeFormula
B2:B7B2=BYROW(A2:A7,LAMBDA(r,SUM(FILTER(Sheet1!C2:C42,(TEXT(Sheet1!B2:B42,"my")=TEXT(r,"my"))*(Sheet1!D2:D42="Payment"),0))))
C2:C7C2=BYROW(A2:A7,LAMBDA(r,SUM(FILTER(Sheet1!C2:C42,(TEXT(Sheet1!B2:B42,"my")=TEXT(r,"my"))*(Sheet1!D2:D42="Deposit"),0))))
Dynamic array formulas.
 
Upvote 1
Would an option where you didn't need to copy anywhere, just put in the top row be worth considering?
DeGeorge.xlsm
BCD
1DateAmountComments
21/04/2019($25.71)Payment
31/04/2019($7.99)Payment
43/04/2019($241.92)Payment
53/04/2019$150.00Deposit
65/04/2019$107.00Deposit
75/04/2019$11.99Deposit
88/04/2019($53.40)Payment
98/04/2019($9.59)Payment
109/04/2019($34.33)Payment
112/05/2019($45.00)Payment
122/05/2019$25.00Deposit
132/05/2019($12.22)Payment
142/05/2019$35.00Deposit
1517/05/2019($6.93)Payment
1620/05/2019($79.73)Payment
1721/05/2019$6,336.00Deposit
1811/12/2023($200.32)Payment
1922/05/2019($118.01)Payment
2028/05/2019($2.90)Payment
2130/05/2019$436.00Deposit
2230/05/2019($19.37)Payment
2331/05/2019$0.28Deposit
243/06/2019($76.15)Payment
253/06/2019$364.00Deposit
263/06/2019($31.74)Payment
274/06/2019($47.50)Payment
285/06/2019($95.00)Payment
295/06/2019$765.00Deposit
305/06/2019($28.50)Payment
3110/06/2019($108.16)Payment
3210/06/2019$679.00Deposit
3310/06/2019($26.80)Payment
3410/06/2019$345.00Deposit
3510/06/2019($19.99)Payment
3610/06/2019($12.79)Payment
3710/06/2019($12.78)Payment
3810/06/2019$234.00Deposit
391/03/2023($100.16)Payment
4012/06/2019$234.00Deposit
4112/06/2019$243.00Deposit
4213/06/2019($4.66)Payment
Sheet1


DeGeorge.xlsm
ABC
1MonthPaymentsDeposits
2Apr-19($372.94)$268.99
3May-19($284.16)$6,832.28
4Jun-19($464.07)$2,864.00
5Jul-19$0.00$0.00
6Aug-19$0.00$0.00
7Sep-19$0.00$0.00
Sheet2
Cell Formulas
RangeFormula
B2:B7B2=BYROW(A2:A7,LAMBDA(r,SUM(FILTER(Sheet1!C2:C42,(TEXT(Sheet1!B2:B42,"my")=TEXT(r,"my"))*(Sheet1!D2:D42="Payment"),0))))
C2:C7C2=BYROW(A2:A7,LAMBDA(r,SUM(FILTER(Sheet1!C2:C42,(TEXT(Sheet1!B2:B42,"my")=TEXT(r,"my"))*(Sheet1!D2:D42="Deposit"),0))))
Dynamic array formulas.

Frank

This is awesome! I never knew anything like this could be done. Need to read up on LAMBDA!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top