[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

# Sum based on custom date ranges

Posted on 2016-10-07
Medium Priority
67 Views
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"

Attached a sample file
EE-date-intervals.xlsx
0
Question by:pdvsa
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 35

Accepted Solution

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

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))

Q_28975177.xlsx
0

Author Closing Comment

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

LVL 35

Expert Comment

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

Good luck with the rest of your project.
0

LVL 33

Expert Comment

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

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are â€¦
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabilâ€¦
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
###### Suggested Courses
Course of the Month13 days, 6 hours left to enroll