+ Reply to Thread
Results 1 to 15 of 15

Calculate sum of sales for the past 12 months

  1. #1
    Registered User
    Join Date
    06-07-2023
    Location
    Bulgaria
    MS-Off Ver
    EXCEL 365
    Posts
    15

    Calculate sum of sales for the past 12 months

    Hi all,

    I am trying to find a formula that its going to help me with my work.

    I have a sheet, with sales for the 12 months from last year + 12 months from this year.

    Is there any way to make a formula that will count the current month sales + the past 11 months ?


    Thank you all
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Trying to find a formula, that calculate past 12months from the current month

    Your sheet design is a problem. And you need to use actual dates for each month, not text that describes the month. See update attached.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,063

    Re: Calculate sum of sales for the past 12 months

    Try,
    Please Login or Register  to view this content.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Calculate sum of sales for the past 12 months

    That does not seem to give the correct answer, at least not in the sample sheet, because this Mar/Apr/May/June are all 0. I suppose it's safe to assume that all months up to the current month have >0 values.

  5. #5
    Registered User
    Join Date
    06-07-2023
    Location
    Bulgaria
    MS-Off Ver
    EXCEL 365
    Posts
    15

    Re: Calculate sum of sales for the past 12 months

    Thank you very much. I think it worked, but could you tell me, when month July comes, is it going to start counting from July ?

    Thank you

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Calculate sum of sales for the past 12 months

    Not sure who you are asking.

    My solution that redesigns your data will start counting back 12 months including the current month. So yes, in July it will start counting in July.

    josephteh's solution finds the first month with a 0, then counts backwards 12 months before that.

  7. #7
    Registered User
    Join Date
    06-07-2023
    Location
    Bulgaria
    MS-Off Ver
    EXCEL 365
    Posts
    15

    Re: Calculate sum of sales for the past 12 months

    Thank you josephteh. It will work, but the only issue I may face is if I have 0 sales in June, and 0 sales in July and let say I start counting from August, where I have 10 sales. I beleive it will start counting from June since, we have 0 sales there.
    Otherwise the formula works like a gold.

    Thanks

  8. #8
    Registered User
    Join Date
    06-07-2023
    Location
    Bulgaria
    MS-Off Ver
    EXCEL 365
    Posts
    15

    Re: Calculate sum of sales for the past 12 months

    Quote Originally Posted by josephteh View Post
    Try,
    Please Login or Register  to view this content.


    Thank you josephteh. It will work, but the only issue I may face is if I have 0 sales in June, and 0 sales in July and let say I start counting from August, where I have 10 sales. I believe it will start counting from June since, we have 0 sales there.
    Otherwise the formula works like a gold.

    Thanks

  9. #9
    Registered User
    Join Date
    06-07-2023
    Location
    Bulgaria
    MS-Off Ver
    EXCEL 365
    Posts
    15

    Re: Calculate sum of sales for the past 12 months

    Quote Originally Posted by 6StringJazzer View Post
    Not sure who you are asking.

    My solution that redesigns your data will start counting back 12 months including the current month. So yes, in July it will start counting in July.

    josephteh's solution finds the first month with a 0, then counts backwards 12 months before that.

    Hi,

    Thank you very much for the formula, I think this is the best solution, but here comes the issue, that I am pretty sure it may be fixed.
    I see from your file, you have made a custom format. Could you please tell, which one did you use? Also did you type 1/1/2022, 2/1/2022, 3/1/2022 etc ?

    Thank you very much again, you guys are majsetics

  10. #10
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,063

    Re: Calculate sum of sales for the past 12 months

    Are you still using Excel 2016?

  11. #11
    Registered User
    Join Date
    06-07-2023
    Location
    Bulgaria
    MS-Off Ver
    EXCEL 365
    Posts
    15

    Re: Calculate sum of sales for the past 12 months

    Quote Originally Posted by josephteh View Post
    Are you still using Excel 2016?
    Hi,

    I beleive the version is 2022. It does say Version 2208 ( Build 15601..)

  12. #12
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,063

    Re: Calculate sum of sales for the past 12 months

    I think your Excel version is 365. Try, =SUM(OFFSET(Table1,0,MAX(XMATCH(FALSE,Table1[[Last Jan]:[This Dec]]="",0,-1)-12,0),1,12)), with blanks (instead of 0) in coming months.

  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Calculate sum of sales for the past 12 months

    Quote Originally Posted by daneca View Post
    ...you have made a custom format. Could you please tell, which one did you use? Also did you type 1/1/2022, 2/1/2022, 3/1/2022 etc ?
    You can see the format by going to Format > Cell > Custom. I believe I used "Mmm yyyy". And I used a formula to create the dates, then converted them to values, so I didn't type each one individually.

  14. #14
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Calculate sum of sales for the past 12 months

    Hi to all!

    Maybe this formula works for you:
    PHP Code: 
    =SUM(TAKE(A$1:XLOOKUP(TEXT(NOW(),"T\hi\s mmm"),Table1[#Headers],Table1[@]),,-12)) 
    Blessings!
    A out-of-context text is a pretext.
    Consider adding reputation points to all the people who help you with your question/problem.

  15. #15
    Registered User
    Join Date
    06-07-2023
    Location
    Bulgaria
    MS-Off Ver
    EXCEL 365
    Posts
    15

    Re: Calculate sum of sales for the past 12 months

    Thank you all for the help.

    The best solution, that worked for me was the suggestion from 6StringJazzer.
    The other formulas work also as well.

+ 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. Calculate hour average for the past 4 months
    By saft_escu in forum Excel General
    Replies: 2
    Last Post: 09-16-2021, 04:38 AM
  2. [SOLVED] Sick pay entitlement - sum to calculate number of days taken within the past 12 months?
    By CRW1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-07-2019, 11:21 AM
  3. Calculate number of occurrences of text in the past 12 months
    By wildbilll in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2015, 03:47 PM
  4. [SOLVED] Calculate number of days between sales and prior sales date
    By maacmaac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-03-2013, 03:07 PM
  5. [SOLVED] Calculate total dollar amount the is past the past due date
    By Barb1980 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-12-2012, 05:34 PM
  6. How to calculate past rent due in months
    By noviceone in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-25-2012, 11:10 AM
  7. Replies: 8
    Last Post: 06-01-2009, 05:22 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