Solved

Sum based on custom date ranges

Posted on 2016-10-07
4
39 Views
Last Modified: 2016-10-11
Experts

I am wishing to sum a data set based on the following date intervals:
"1-5"   "6-15"   "16-25"    "26- end of month"

Grateful for your help.
Attached a sample file
EE-date-intervals.xlsx
0
Comment
Question by:pdvsa
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 500 total points
ID: 41834754
Is this any use to you?

Q_28975177 Sample Results using SUMPRODUCT(...)
Formula in cell [V4]:
=SUMPRODUCT((DAY($A4:$A47)>=$R4)*(DAY($A4:$A47)<=$S4)*(MONTH($A4:$A47)=$T4)*(YEAR($A4:$A47)=$U4)*($E4:$E47))

Formula in cell [W4]:
=SUMPRODUCT((DAY($A4:$A47)>=$R4)*(DAY($A4:$A47)<=$S4)*(MONTH($A4:$A47)=$T4)*(YEAR($A4:$A47)=$U4)*($G4:$G47))

Please see the attached workbook.
Q_28975177.xlsx
0
 

Author Closing Comment

by:pdvsa
ID: 41834766
brilliant. simply brilliant.  I can definitely use that.  thank you very much.
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 41834939
You're very welcome.  Thanks for closing the question so promptly.

Good luck with the rest of your project.
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41838277
With a minor tweak to the data you could also use a Pivot Table.

In a spare area of the sheet set up the following small table:

1      1-5
6      6-15
16      16-25
26      26-Month End

In a new column next to your data use the following formula to group the dates:

=VLOOKUP(DAY(A4),$T$3:$U$6,2)   where T3:U6 is your small table.

You can then use the Group field as a row value in a Pivot Table to summarise the data.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now