Forum Discussion

robgill205's avatar
robgill205
Copper Contributor
May 02, 2023
Solved

Formula/Conditional Formatting to calculate months totals

Hi

 

I have headings of all the months and some figures beneath them. At the end after December, i have a year to date total so for April i would have the sum of January to April with the heading YTD April. I want to find out of theres a way to automate this where i could change the heading to YTD May and it would increase the range to add up the extra month. 

Thanks

  • mathetes's avatar
    mathetes
    Silver Contributor

    robgill205 

     

    It would be a lot easier--a LOT easier--to help you with this if you are able to post either a copy of the actual spreadsheet, or, if the actual contains confidential info, a mockup of it--on OneDrive or GoogleDrive, with a link pasted here that grants us access to it.

     

    The reason for that request is that so much depends on how you've laid out your data. I (we) can make assumptions, but in order to be more helpful with your specifics it would be far more helpful to you to base any suggestions on your actual layout.

  • robgill205 

    In the heading for the YTD column, enter the formula

    ="YTD "&TEXT(TODAY(), "mmmm")

     

    Let's say your month headings are in B1 (January) to M1 (December)

    In the YTD cell for row 2, enter the formula

    =SUM(B2:INDEX(B2:M2, MONTH(TODAY())))

    Fill down.

Resources