Sumifs of dates.xlsx
Just need to sum the data by the month and year input. Only seems to be taking the first date from the month rather than all the dates from the month?
Sumifs of dates.xlsx
Just need to sum the data by the month and year input. Only seems to be taking the first date from the month rather than all the dates from the month?
One option
Put the number of the month in cell E1, rather than the text, and use:
=SUMIFS(B2:B7,A2:A7,">="&DATEVALUE("01/"&E1&"/"&E2),A2:A7,"<"&DATEVALUE("01/"&E1+1&"/"&E2))
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Hi try this
Formula:Please Login or Register to view this content.
but in E1 type 12-01-01 with such format "mmm"
Regards
tom1977
If You are satisfied with my solution click the small star icon on the left to say thanks.
@tom1977
Doesn't take into account the year. Have tried this, but just returns 0, confused :S
Please Login or Register to view this content.
Last edited by Cutter; 09-19-2012 at 12:25 PM. Reason: Removed whole post quote
@TMShucks
Bit messy but works, thanks
Last edited by Cutter; 09-19-2012 at 12:25 PM. Reason: Removed whole post quote
How is it messy? You've split the date parameters across two cells. You could just put the date in cell E1 as 01/01/2012 and format as "mmm". And in cell E2, if you wanted, you could put =E1 and format as "yyyy". So then you'd see "Jan 2012"
Then you could use the SUMPRODUCT with MONTH and YEAR just referring to cell E1.
I suspect that SUMIFS would be better but you'd need to adjust the formula I provided ... references to E1 would become MONTH(E1) and E2 would be YEAR(E1)
Regards, TMS
Not messy as such, just a bit long winded, was hoping for a short formula so that the less excel minded can understand in the office.
I've adapted it to this Sumifs of dates.xlsx like you suggested.
Last edited by Cutter; 09-19-2012 at 12:26 PM. Reason: Removed whole post quote
=SUMPRODUCT((MONTH($A$2:$A$7)=MONTH($E$3))*(YEAR($A$2:$A$7)=YEAR($E$3))*($B2:$B$7))
Please don't quote whole posts as it just makes the thread untidy and long winded.
Regards, TMS
the correct sumproduct version is
=SUMPRODUCT((MONTH($A$2:$A$7)=MONTH($E$3))*(YEAR($A$2:$A$7)=YEAR($E$3)),$B$2:$B$7)
or
=SUMPRODUCT(--(TEXT($A$2:$A$7,"yyyymm")=TEXT($E$3,"yyyymm")),$B$2:$B$7)
Josie
if at first you don't succeed try doing it the way your wife told you to
Here is another option:
=SUMIFS(B2:B7,A2:A7,">="&EOMONTH(E7,-1)+1,A2:A7,"<"&EOMONTH(E7,0))
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
No, it's not. It's actually rule 12:I that sarcasm?
12. Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
Sometimes a moderator will tidy up after you ... but they're not your mother, so you should do it yourself ... that's sarcasm.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
Apologies, I haven't sat and read the rules.
I quote it all because I find it easier to follow the thread. That is ofc my opinion. However whoever thought up that rule, their opinion is quoting properly clutters a thread. Each to their own. Maybe they should be more open minded, maybe I should.
I shall follow the rules from now on.
@benoj2005: no problem.
@JosephP: thanks for the rep. And, of course, for your imaginative alternatives. It always impresses me that there are so many different approaches to problems
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks