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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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),"")
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,681
Members
449,048
Latest member
81jamesacct

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