+ Reply to Thread
Results 1 to 6 of 6

Calculating % change from the previous year

  1. #1
    Registered User
    Join Date
    05-22-2021
    Location
    Canada
    MS-Off Ver
    365
    Posts
    31

    Calculating % change from the previous year

    Greetings,

    I have a dataset on expenses and am trying to calculate three different, but similar percentages:

    1. % change in total expenses, year-to-date (relative to last year's total given the same number of days)
    2. % change in total expenses for the current month (relative to last year's total for that same month)
    3. % change in total expenses for the current quarter (relative to last year's total for that same month)

    This is a bit tricky because I need to somehow match the time periods to ensure a fair comparison (e.g. it would be wrong to compare the total expenses for the month of March this year wherein only half the month has passed to all of the expenses for March of last year).

    For example, in the dataset that I included, March expenses for the current year are only incurred on two days (March 2nd and 5th). Assuming that March 5th is the current day and I want to calculate the % change in total expenses, YTD, I would compare the total expenses up to the 5th for the current year relative to the total expenses up to the 5th for 2022.

    Ideally, the calculation of each of these reflects how I use my slicer (e.g. so if I select 2023, then comparisons are made to 2022; 2022 to 2021, etc.)
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Calculating % change from the previous year

    If the following presentation is acceptable to allow further analysis then Power Query may be the solution.

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Year Total Year Month Sum Year Quarter Sum
    2
    2022
    2271.47
    2022
    January
    782.58
    2022
    Q1
    2271.47
    3
    2023
    1145.91
    2022
    February
    874.31
    2023
    Q1
    1145.91
    4
    2022
    March
    614.58
    5
    2023
    January
    783.64
    6
    2023
    February
    339.41
    7
    2023
    March
    22.86
    Sheet: Table1
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Calculating % change from the previous year

    Pl see file . T2 and U2 are not giving values because September, current month, data not available. For verification change the month manually in Q2 and check.
    Try.
    In S2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


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


    In U2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Registered User
    Join Date
    05-22-2021
    Location
    Canada
    MS-Off Ver
    365
    Posts
    31

    Re: Calculating % change from the previous year

    Quote Originally Posted by alansidman View Post
    If the following presentation is acceptable to allow further analysis then Power Query may be the solution.

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Year Total Year Month Sum Year Quarter Sum
    2
    2022
    2271.47
    2022
    January
    782.58
    2022
    Q1
    2271.47
    3
    2023
    1145.91
    2022
    February
    874.31
    2023
    Q1
    1145.91
    4
    2022
    March
    614.58
    5
    2023
    January
    783.64
    6
    2023
    February
    339.41
    7
    2023
    March
    22.86
    Sheet: Table1
    Thank you for this response, Alan. I will have to explore Power Query more to better understand your solution.

  5. #5
    Registered User
    Join Date
    05-22-2021
    Location
    Canada
    MS-Off Ver
    365
    Posts
    31

    Re: Calculating % change from the previous year

    Quote Originally Posted by kvsrinivasamurthy View Post
    Pl see file . T2 and U2 are not giving values because September, current month, data not available. For verification change the month manually in Q2 and check.
    Try.
    In S2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


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


    In U2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you, kvsrinivasamurthy. I think I understand the structure of your solution, but it is not quite yielding the right answer and I do not know why.

    A couple of things.

    First, I think the numerator and denominator are mixed up. The typical formula is (V2 - V1)/V1 or equivalently (V2/V1) - 1 I believe.

    Still, when I calculate the sums manually to determine the % change, it doesn't equal what the formula gives and I don't know why. For example, suppose I set the month to March. The total expenses for this year up until March 5th is approximately 1,145 and for lasts year it is 1,820. This gives a % difference of -37%, but your formula shows -50.13%.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Calculating % change from the previous year

    Revised formulas
    In S2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    In U2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. Calculating Change From Previous Version
    By saq7792 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-29-2023, 01:37 PM
  2. Replies: 0
    Last Post: 03-29-2022, 04:59 PM
  3. Find dates in current year and previous year delete rows.
    By kreiner2006 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2019, 05:13 PM
  4. How can I show Year to Date orders from previous year quickly?
    By CenterShock in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-02-2015, 05:26 PM
  5. Replies: 12
    Last Post: 06-10-2013, 05:42 PM
  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. Calculating monthly totals for current and previous year
    By Pieman in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-26-2006, 08:45 AM

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