Forum Discussion
robgill205
May 02, 2023Copper Contributor
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
See the attached version
- mathetesSilver Contributor
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.
- robgill205Copper Contributor
mathetes I've attached an example here, as you can see the "YTD April" is linked back to another sheet. This is because I reuse the same template for every month and just change the month and it updates across all sheets.
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.
- robgill205Copper Contributor
That works thanks, I've attached an example so you could see if this was still possible with a slight adjustment. The YTD heading in M2 will need to be linked to a summary cover page. Thanks
Sorry, I hadn't noticed that you replied while I was composing a reply.