Solved

SUMIF to sum quarter instead of month.

Posted on 2013-06-15
2
581 Views
Last Modified: 2013-06-16
I got this code from here earlier today but now I need to modify it to do the same thing but sum my data by quarter instead of month & year. I have my quarters formatted to Q1-13. I want it to match the value in cell C49 instead of C18 as shown in the code below.


=SUMIFS(Database!$V:$V,Database!$H:$H$,$A$10,Database!$AP:$AP,$B19,Database!$C:$C,">="&EOMONTH(C$18,-1)+1,Database!$C:$C,"<"&EOMONTH(C$18,0)+1)

Open in new window


Modified post...I also need to do the same thing for a year as well in a separate formula.
0
Comment
Question by:Lawrence Salvucci
2 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 39251021
It would probably be simpler just to list the start and end dates, so if you want 1st April to 30th June 2013 just list those two dates in C49 and D49 and use this formula in E49

=SUMIFS(Database!$V:$V,Database!$H:$H$,$A$10,Database!$AP:$AP,$B19,Database!$C:$C,">="&C49,Database!$C:$C,"<="&D49)

You can then do the same for the year by putting 1st Jan in one cell and 31st December in another

If you want to calculate directly from Q1-13 that will make the formulas more complex.....but it can be done if you want, e.g. with Q1-13 or similar in C49 that could be

=SUMIFS(Database!$V:$V,Database!$H:$H$,$A$10,Database!$AP:$AP,$B19,Database!$C:$C,">="&MID(C49,2,1)*3-2&"/1/"&RIGHT(C49,2),Database!$C:$C,"<"&MID(C49,2,1)*3+1&"/1/"&RIGHT(C49,2))

or for the whole year with year like 2012 in C50 try

=SUMIFS(Database!$V:$V,Database!$H:$H$,$A$10,Database!$AP:$AP,$B19,Database!$C:$C,">=1/1/"&C50,Database!$C:$C,"<1/1/"&C50+1)

I'm assuming you are using US regional settings for those latter two formulas....

regards, barry
0
 
LVL 1

Author Closing Comment

by:Lawrence Salvucci
ID: 39251379
Thanks Barry! Appreciate your help again!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question