Using Month query inside sumif formula

Jpull

New Member
Joined
Jun 5, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi, First time posting....

I am trying to create a formula to sum the columns if the month is greater than or equal to todays month.

For example:

Row / Column
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
11Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sept-24Oct-24Nov-24Dec-24Sum
13Data 1555550.25-2-1-0.53-21
14Data 21010101010-3-5-2-21-42

The formula in the Sum column should only calculate the column amounts fr the row when the month is greater than or equal to today. So as today is June, the Sum for Data Line 1 should be: -1.75 and for data line 2: -13

I have the month of todays date showing in cell B1 of my spreadsheet to also use in the formula.

I've so far tried with SUMIFS, SUMPRODUCT and a couple of others but at present i'm not getting it to work.

If i use: =SUMIF(E11:P11,$B$1<=MONTH(E11:P11),E13:P13), then the formula spills but doesnt work

If i use: =SUMIF(E11:P11,$B$1<=MONTH(),E13:P13), the formula errors

Any help or suggestions welcome, i'm sure i've just overlooked something simple
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
The cleanest way I could come up with does include the addition of a helper row to populate the month number under the month header in row 11. I've placed that in Row 12.
Excel Formula:
=SUMIF(D$12:O$12,">="&MONTH($B$1),$D13:$O13)

1717592381308.png
 
Upvote 0
Or maybe:

Excel Formula:
=SUM(FILTER(E13:P13,EOMONTH(+$E$11:$P$11,0)>=$B$1))
 
Upvote 0
Here is a solution using SUMPRODUCT function:
but I come up with different results:
Book1
ABCDEFGHIJKLMNOPQ
4Month:2024-06-01
5
6
7
8
9
10Row / ColumnDEFGHIJKLMNOPQ
111124-Jan24-Feb24-Mar24-Apr24-May24-Jun24-Jul24-Aug24-Sep24-Oct24-Nov24-DecSum
1213Data 1555550.25-2-1-0.53-22.75
1314Data 21010101010-3-5-2-21-4-5
14
15000010-3-5-2-21-4
Sheet1
Cell Formulas
RangeFormula
P12P12=SUMPRODUCT(((MONTH(D4)<=MONTH($E$11:$O$11))*(E12:O12)))
P13P13=SUMPRODUCT(((MONTH(D4)<=MONTH($E$11:$O$11))*(E13:O13)))
E15:O15E15=(((MONTH(D4)<=MONTH($E$11:$O$11))*(E13:O13)))
Dynamic array formulas.
 
Last edited:
Upvote 0
I'm assuming that your posted data is inadvertently offset to the right by one column?

However, assuming that D11:O11 is the first of each month then here is my SUMIF suggestion.

AutoTraining.xlsm
DEFGHIJKLMNOP
11Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24Dec-24SUM
12555550.25-2-1-0.53-22.75
131010101010-3-5-2-21-4-5
Sheet1
Cell Formulas
RangeFormula
P12:P13P12=SUMIF(D$11:O$11,">="&TODAY()-31,D12:O12)
 
Upvote 1
Solution
amazing thank you guys! i used the last option =SUMIF(D$11:O$11,">="&TODAY()-31,D12:O12) which works perfectly, for some reason the other 2 before still didn't give me the result but again i may have overlooked something!

Really appreciate the help and even more so the speed of it - really impressed guys and i will certainly be back next time i have an issue :)
 
Upvote 0
I'm assuming that your posted data is inadvertently offset to the right by one column?

However, assuming that D11:O11 is the first of each month then here is my SUMIF suggestion.

AutoTraining.xlsm
DEFGHIJKLMNOP
11Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24Dec-24SUM
12555550.25-2-1-0.53-22.75
131010101010-3-5-2-21-4-5
Sheet1
Cell Formulas
RangeFormula
P12:P13P12=SUMIF(D$11:O$11,">="&TODAY()-31,D12:O12)
This was great thank you Snakechips!
 
Upvote 0

Forum statistics

Threads
1,224,737
Messages
6,180,659
Members
452,992
Latest member
TokugawaIesuma

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