Reverse Calculating an Average

ONEIL290

New Member
Joined
Nov 19, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I was hoping to figure out how if I have an average number, to have excel automatically calculate the numbers in a range required to have that output.
For example if I want the average to be 50% and I have a range of 30 inputs, what would those 30 numbers need to be? Also if I manually input numbers in the range I want it to automatically adjust the calculated numbers to still satisfy the average. EX: If I want the average to be 50% and I have numbers 55%, 60%, 58%, 52%, what will the remaining 26 numbers need to be to average 50%?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
You'd only need 1 free input to achieve the desired average.
 
Upvote 0
It doesn't matter what the first 29 inputs are so you can use random generators like RANDARRAY() for the first 29.

Book1
AB
1Desired Average50%
2n30
3
4#Example
5198.3%
6216.8%
7390.1%
8493.1%
9574.4%
10696.4%
11750.5%
12896.3%
13965.7%
141036.1%
151133.7%
161229.5%
171318.0%
181421.9%
191588.5%
20166.4%
211790.6%
22187.4%
231936.6%
242054.2%
252135.5%
262251.5%
272320.8%
282428.2%
292546.5%
302694.0%
312798.9%
322873.7%
332919.7%
3430-73.5%
Sheet2
Cell Formulas
RangeFormula
A5:A34A5=SEQUENCE(B2)
B5:B33B5=RANDARRAY(B2-1)
B34B34=$B$1*B2-SUM(B5#)
Dynamic array formulas.
 
Upvote 0
Since you have not really defined any set of rules or guidelines for this, there are many different ways to do it (there is literally no limit to the number of possibilities that would work, it is infinite).

One simple way would be to calculate what the next record would have to be to get the average to where you want, and then set every single record after that equal to the average, i.e.

1732034667291.png


So cell B1 is your desired average and cells A1:A4 are your initial values.
You could use this formula in cell A5 to get the next record so that the average will be exactly your desired value:
Excel Formula:
=(B1*(COUNT(A1:A4)+1))-SUM(A1:A4)
and then just use your average for the rest of the entries, i.e. put in cell A6 and copy down to A30:
Excel Formula:
=$B$1
 
Upvote 1
Since you have not really defined any set of rules or guidelines for this, there are many different ways to do it (there is literally no limit to the number of possibilities that would work, it is infinite).

One simple way would be to calculate what the next record would have to be to get the average to where you want, and then set every single record after that equal to the average, i.e.

View attachment 119440

So cell B1 is your desired average and cells A1:A4 are your initial values.
You could use this formula in cell A5 to get the next record so that the average will be exactly your desired value:
Excel Formula:
=(B1*(COUNT(A1:A4)+1))-SUM(A1:A4)
and then just use your average for the rest of the entries, i.e. put in cell A6 and copy down to A30:
Excel Formula:
=$B$1

Your solution is very close to what I'm looking for. This does solve my question but a little more context is I want to know what continuous number needs to be filled in, which yours will show the calculated then will repeat the 50. What I'm trying to solve with full context is what number will be needed to sustain (minimum required) over the rest of the range. Below is a screen shot of what I'm trying to fill out. I manually figured out the numbers in the highlighted cells, but is there a way for that to auto fill the calculated number? I will input a new number every day next to the respective date and I want the rest of the days to automatically to fill in the calculated number (highlighted cell) to equal the target number.

1732039948278.png
 

Attachments

  • 1732039781625.png
    1732039781625.png
    14.9 KB · Views: 2
Upvote 0
Do you mean that you want to average it out, so you populate all the missing values with the same number, and get to your desired average, something like this?
1732040732510.png


If so, here is the formula I put in cell A5 and copied down to A30:
Excel Formula:
=((30*$B$1)-SUM(A$1:A$4))/(30-COUNT($A$1:$A$4))
 
Upvote 1
Solution
Do you mean that you want to average it out, so you populate all the missing values with the same number, and get to your desired average, something like this?
View attachment 119451

If so, here is the formula I put in cell A5 and copied down to A30:
Excel Formula:
=((30*$B$1)-SUM(A$1:A$4))/(30-COUNT($A$1:$A$4))
Yes that's it. this will work as I can adjust the number (30) to the desired amount I need for the full range. Is there anyway to make it auto adjust so that when I manually fill in cell A5 with a new number. say 60, it will auto adjust cells A6-A30 to the new number needed to have the average of 50? Essentially to have the sum range automatically expanding so I wont have to change it in the formula.
 
Upvote 0
You can replace any of the hard-coded references in the formula with a cell reference (where you store the value you want to use).
Just remember that if you are going to be copying the formula down a number of rows that you will need to use absolute range referencing (i.e. $A$5 instead of A5).
 
Upvote 0
You can replace any of the hard-coded references in the formula with a cell reference (where you store the value you want to use).
Just remember that if you are going to be copying the formula down a number of rows that you will need to use absolute range referencing (i.e. $A$5 instead of A5).
I'm able to do it just by moving the calculated to be displayed in only one cell which satisfies my needs. I can add data to the range and it auto updates. Thank you very much for your help!
1732044286466.png
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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