Fill average to right for multiple columns

JODomingos

New Member
Joined
Jul 11, 2020
Messages
48
Office Version
  1. 2016
Platform
  1. Windows
Hi Friends.
I need a macro to fill the average formula in the cell B15. The range used, it must be the one selected from above (B2:B12). After that fill the formula right to the next columns (C, D, E......) until the last.
But the point is that the range can be variable, sometimes i have from B2:B67 for instance, so it would be nice if i can use the column A as reference for average until the last row. Because sometimes i have some blanks in the columns. (Pink cells).

Can you help me guys?

Thanks in advance


1611512586306.png
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Dossfm0q

Banned User
Joined
Mar 9, 2009
Messages
570
Office Version
  1. 2019
Platform
  1. Windows
Book1
BCD
2-1-1-1
3-1-1-1
4-1-1
51-1-1
6-1-1-1
7-1
8-1-1-1
9-1-1
101-1-1
111-1-1
12-1-1
13
14
15-0.142857143-1-1
Sheet1
Cell Formulas
RangeFormula
B15:D15B15=IF(COUNTA(B$1:B$11)<>0,SUM(B$1:B$11)/COUNTA(B$1:B$11),"")
 

Watch MrExcel Video

Forum statistics

Threads
1,129,724
Messages
5,637,997
Members
416,998
Latest member
bbowne

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
Top