Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sum Previous Month and Previous Year Data by Date Formula

Posted on 2016-11-23
4
Medium Priority
?
252 Views
Last Modified: 2016-11-25
I need to add Previous Month and Previous Year Totals to my data set and Pivot Table in the attached file. Rather than the tedious Manual summing is there an Excel formula which can achieve this?

Paul
PrevMthPrevYearSum.xlsx
0
Comment
Question by:Paul Clayton
[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
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Expert Comment

by:nathaniel
ID: 41900276
You may want to use the DATEDIF Formula to identify previous Month or Year or even Days

Reference: https://support.office.com/en-us/article/Calculate-the-difference-between-two-dates-8235e7c9-b430-44ca-9425-46100a162f38
0
 

Author Comment

by:Paul Clayton
ID: 41900384
Hi Nathaniel,

I had already looked at that and I don't think it will work. From my limited knowledge it seems to me that somehow columns F & G are maybe an offset (???) calculation from column E which is summed by month or year (in the Pivot table???) subtracting the DATE value by 1 month or one year respectively.

For  the ONE MONTH PREVIOUS case reference value on 12 September 2015 (E377) (i.e. =sum(E345:E376 (=Sum of Revenue)) for the preceding MONTH (11 September 2015 to 10 August 2015), and
For the ONE YEAR PREVIOUS case the reference value on 12 September 2015 (i.e. =sum(E11:E377 (=Sum of Revenue)) for the preceding YEAR (11 September 2015 to 10 September 2014

Does that make it clearer?

Paul
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 2000 total points
ID: 41900406
For previous month use formula:

=SUMIFS($E:$E,$C:$C,">="&DATE(YEAR(Table_Rev[@Date]),MONTH(Table_Rev[@Date])-1,DAY(Table_Rev[@Date])+1),$C:$C,"<="&Table_Rev[@Date])

For previous 12 months use:

=SUMIFS($E:$E,$C:$C,">="&DATE(YEAR(Table_Rev[@Date]),MONTH(Table_Rev[@Date])-12,DAY(Table_Rev[@Date])+1),$C:$C,"<="&Table_Rev[@Date])

Hope that works for you.

Thanks
Rob H
0
 

Author Comment

by:Paul Clayton
ID: 41901172
Hi Rob H,

The formula that you have provide work OK so technically you have answered my question. However to make this work in the context of the project I have had to put the formula in a second sheet and pivot table to get the output that I am looking for. Ultimately there are inputs which will be entered by the users for particular columns for both sheets/pivot tables through a Userform.

As you will see from the attached file the formula that you have provided are only required on the 1st day of each subsequent month which makes sheet 2 very messy to manually enter the formula.

My question/query is: an the formula be somehow 'scheduled' to only occur on the 1st day of each calendar month from sheet 1 rather than partially duplicating the data into sheet 2?

Any idea why the file is so big???

Thanks,
Paul
PrevMthPrevYearSum-1.xlsx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

704 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