I am trying to SUM a range IF the month of another range equals today's month. The formula I am trying, which doesnt work, is
=SUM(IF(MONTH(K:K)=MONTH(TODAY()),J:J,0))
Any ideas? Thanks!
I am trying to SUM a range IF the month of another range equals today's month. The formula I am trying, which doesnt work, is
=SUM(IF(MONTH(K:K)=MONTH(TODAY()),J:J,0))
Any ideas? Thanks!
=sumproduct(--(month(k1:k100)=month(today())),j1:j100)
Life's a spreadsheet, Excel!
Say thanks, Click *
Have you committed the formula with Ctrl+Shift+Enter ? ( array formula)
Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.
Click on GO ADVANCED and use the paperclip icon to open the upload window.
View Pic
Ben Van Johnson
maybe try adding a helper column to extract the month number, and then base the sumif() on that?
OR if you have 2007 and later, use the sumifS() function...
=SUMIFS($B$2:$B$16,$C$2:$C$16,">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1),$C$2:$C$16,"<="&DATE(YEAR(TODAY()),MONTH(TODAY())+1,-1))
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Thanks Ace, but a simple copy/paste of that formula doesn't work and I am not sure how to fix it. Thanks, also, Pepe Le mokko but hitting Ctrl+Shift+Enter within my current formula turns the result from a "0" to a VALUE error.
ProtonLeah, I have attached the example. Of course, my real file is much more extensive or I would not bother automating it. My goal is for the "Checks to be received" formula to find all checks with the current month's date and SUM them. Thanks for the help!
Nevermind, FDibbins nailed it. Thanks!
This won't work in all cases because this part
DATE(YEAR(TODAY()),MONTH(TODAY())+1,-1)
gives you the day before the end of the month (e.g. this month it gives 30th August not 31st). You need a zero in place of the -1
You might find it simpler to use EOMONTH function like this
=SUMIFS($B$2:$B$16,$C$2:$C$16,">="&EOMONTH(TODAY(),-1)+1,$C$2:$C$16,"<"&EOMONTH(TODAY(),0)+1)
Audere est facere
lol I knew there was an easier way as I was putting that together, but the light didnt come on...thanks )
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks