+ Reply to Thread
Results 1 to 7 of 7

Year to Date This Year vs YTD Last Year

  1. #1
    Registered User
    Join Date
    08-27-2006
    Posts
    48

    Year to Date This Year vs YTD Last Year

    Hi,

    I have a dashboard that is fed from a pivot table. I want to be able to have a running total for YTD, but last year (a second pivot table is fine). So as of today, I would want to see 1/1/15 through 4/1/15 (my dates are all the first of the month). I know I could just use the date as a filter on a pivot table and manually update each month, but would prefer it to be automatically updated.

    Thanks,

    David

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Year to Date This Year vs YTD Last Year

    Hi,

    Personally I'd bypass the Pivot Table and use the original data.
    So assuming your dates are in column A and values in column B on Sheet1

    In C1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    C2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then for your dashboard running total use a simple SUMIFS() function.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-27-2006
    Posts
    48

    Re: Year to Date This Year vs YTD Last Year

    Thanks Richard. I wanted to use a pivot table because I have 8 metrics I need to pull into the dashboard, four of which are calculated fields. The raw data is used by other pivot tables, with those same calculated fields, so I thought it would economical to go that route rather than reconfigure my raw data or making long formulas to perform the calculations.

    The other reason is because the dashboard is dynamic. The metrics (that aren't YTD) can change based on the country choosen from a slicer. This YTD would also need to change based on that information.

  4. #4
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Year to Date This Year vs YTD Last Year

    try adding another column in your source data to show the Year.

    =Year()

    then adjust your pivot table
    If I've helped U pls click on d *Add Reputation

  5. #5
    Registered User
    Join Date
    08-27-2006
    Posts
    48

    Re: Year to Date This Year vs YTD Last Year

    Ok. I figured out how to modify your idea and turn it into a helper column. I used:

    =IF(AND(G2>=DATE(YEAR($C$6)-1,1,1),G2<=DATE(YEAR($C$6)-1,MONTH($C$6),1)),"YTD","")

    Where G2 is the date I am evaluating and C6 is the date it's evaluating it against, since my report goes through the first of last month. Now I will use the YTD column for a slicer.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Year to Date This Year vs YTD Last Year

    Quote Originally Posted by seethesun View Post
    Thanks Richard. I wanted to use a pivot table because I have 8 metrics I need to pull into the dashboard, four of which are calculated fields. The raw data is used by other pivot tables, with those same calculated fields, so I thought it would economical to go that route rather than reconfigure my raw data or making long formulas to perform the calculations.

    The other reason is because the dashboard is dynamic. The metrics (that aren't YTD) can change based on the country choosen from a slicer. This YTD would also need to change based on that information.
    Nevertheless I still don't understand why you can't use the original data. After all the Pivot Table is at the end of the day an alternative view of the original data and it derives all its information from the data. If you have a calculated field in the PT then there'll be a formula that you can use to address the data and give you the same result as you'll get from a PT.

    Just as you can use Slicers to filter totals from a PT you can use functions to filter that same information directly from the data.

    The PT is a convenient way of presenting data but since the layout can change depending on how fields are moved around I don't think it's safe to base say dashboard information on a particular PT cell which may not be in the same position when a PT layout is changed.

  7. #7
    Registered User
    Join Date
    08-27-2006
    Posts
    48

    Re: Year to Date This Year vs YTD Last Year

    The pivot table, once set up, is behind the scenes and should not change. Yes, technically someone could get in there and mess with something, but they can just as easily do so with a formula in a cell.

    It's easier and less messy than trying to construct a formula or formulas to get everything working.

    Instead, I created one column in my raw data, created pivot table with the YTD, tied it to the slicer on the dashboard, and referenced the metrics in the dashboard.

    I do appreciate the help and I definitely would have been at it longer if I didn't have your formulas to start off with.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 11-23-2014, 06:02 AM
  2. Automatically update year interval cycles from year to year
    By trumptight in forum Word Programming / VBA / Macros
    Replies: 8
    Last Post: 08-21-2014, 10:38 PM
  3. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  4. [SOLVED] Year on Year data review compared to todays date
    By mintribe in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-24-2013, 06:19 AM
  5. Input a year to determine the start date for 4-4-5 Calendar Year.
    By mak1176 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-25-2013, 10:34 AM
  6. [SOLVED] Keeping a date as current year, even though formula determines previous year
    By dropanddrive03 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2013, 08:31 PM
  7. [SOLVED] Count days for specific year falling within in multi-year date range
    By jslo2013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2012, 05:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1