How to have a formula auto update based off the number of filled rows.

Yaeger38

New Member
Joined
Mar 4, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am attempting to calculate the yearly difference as a percentage for month to date sales and gross profit dollars. The formula I am using for previous months is as follows

=Average(H8:H31)/Average('2023'!H8:H31)-1 & =Sum(H8:H31)/Sum('2023'!H8:H31)

Is there a way to adapt this formula for the current month so that it auto updates based on the number of filled columns in the 2024 worksheet? Picture examples of the data I'm working with are shown below.

2023
1709581832006.png


2024
1709582359879.png


The results of my formulas returns the following (Displays the difference between 2024 & 2023/2022/2021)
1709582586712.png


I essentially want a formula that calculates the average and sum based off of the number of days that have currently passed in the current month, without the need to manually update the formula.
Any suggestions or ideas would be greatly appreciated.

*Note* I know the easy option is to just update the cell references as each day passes, but I would like for this to be automatic.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top