# Fill average to right for multiple columns

#### JODomingos

##### New Member
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?

### 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
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),"")

Replies
5
Views
177
Replies
5
Views
112
Replies
1
Views
342
Replies
8
Views
85
Replies
3
Views
80

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.

### Which adblocker are you using?

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

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