SUMIF for Current Month, Next Month, etc.

GriffinCO

New Member
Joined
Jun 8, 2010
Messages
7
Hello All,

I'd like to set up a chart to track data so I know what sales are pending for this month, next month, etc. Here's my data:

Excel1.png


So what I'd like is a value for Total Sales for the Current Month, Total Sales for Next Month, etc. So when I add another sale to the table, it updates automatically.

Tried to build a formula =SUMIF(A:A,"="&MONTH(TODAY()),B:B) but that didn't work. I know I'm missing something in calculating the current month using a serial number value, since MONTH doesn't return a serial number like NOW does.

I'm sure there's a better way of writing this code. Any help is greatly appreciated!

Cheers,
Jamie

Excel 2007 XP
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi there, welcome to the board!

These should work for you...

Sum this months figures, adjust range accordingly:
Code:
=SUMIF(A2:A6,">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1),B2:B6)-SUMIF(A2:A6,">"&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1),B2:B6)

Sum next months figures, adjust range accordingly:
Code:
=SUMIF(A2:A6,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1),B2:B6)-SUMIF(A2:A6,">"&DATE(YEAR(TODAY()),MONTH(TODAY())+2,1),B2:B6)

Edit: Also, by the way, if your table has a name, i.e. Table1, then you can use the table name definitions in your formula and it will always adjust accordingly...

This month:
Code:
=SUMIF(Table1[Date],">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1),Table1[Sale Price])-SUMIF(Table1[Date],">"&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1),Table1[Sale Price])
Next month:
Code:
=SUMIF(Table1[Date],">="&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1),Table1[Sale Price])-SUMIF(Table1[Date],">"&DATE(YEAR(TODAY()),MONTH(TODAY())+2,1),Table1[Sale Price])

HTH
 
Last edited:
Upvote 0
Hi Zack,

Thanks! Works like a champ. :)

How would I set it up so that it automatically incorporates any new sales I put into the table? Do I need to create some sort of dynamic named range? Or can I just use A:A, B:B?

Cheers!
Jamie
 
Upvote 0
Sorry, I edited the post to include a dynamic set of formulas for your table, just adjust the table name.
 
Upvote 0

Forum statistics

Threads
1,226,290
Messages
6,190,092
Members
453,594
Latest member
rk_rk

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