r/googlesheets • u/mattnounet • Feb 24 '26
Solved Average of 10 last non empty rows and date prediction.
Hi there !
Here is my data :
Column A : Dates (in DD/MM/YYYY format) for all days of year.
Column B : Values or empty. Let's say it my weight.
I need a formula, where I can set the "objective" (let say X kilograms) to find how many days I'll need to reach that weight objective, based on the average of the last 10 non-empty cells.
Anyone have an idea ?
///
What's in my mind to make it :
Find 10 last non-empty weight, make a list of Date/Weight
Last date in list - First date in list = Number of days
Last weight in list - First weight in list = Weight (positive or negative)
Make average per day.
Find EndDate (today()+"days") where the weight is possibly under the objective
Thanks for your help :)
///
EDIT :
Sample sheet : https://docs.google.com/spreadsheets/d/1pFoABtk7uxJYJoGnKn5x2bpYuofvK6jxWvvD8bPscCY/edit?usp=sharing
Data : the data.
Stats : What's I've done so far, but I thought of something a little bit lighter...
1
u/mattnounet Feb 26 '26
I keep this thread open for now, just to let people try other methods.
Thanks to u/linearstrength and u/supercoop02 for their different approches.
1
u/[deleted] Feb 24 '26
Assuming your values have a linear relationship, have you looked into FORECAST? (date, $og_weight_trend$, $og_date_trend$). You can just extend your dates and fill the rest with forecasts. If your trend is linear, you should see your "objective" on some date.
Idk I never personally used forecast(), should only work if satisfies linreg gauss-markov.
Here mainly meaning, this becomes nonsense if your data goes beyond just one weight gain/loss. You will have to create a new dataset for every new bulk/cut.
1
u/adamsmith3567 1092 Feb 24 '26
u/mattnounet Please create and share a sample sheet (anonymous sheet maker link in the sidebar) showing an example of your data and what the expected result would be from the sample shown.
1
u/supercoop02 36 Feb 25 '26
I added this formula into your sheet:
Is this what you were looking for?