formula Average

Marky

New Member
Joined
Feb 22, 2002
Messages
3
If got an excelsheet with 7 different numbers in 7 cells in each cell one number.
If I want to know the average i'll just use the formula, and all the numbers wil be added and divided by 7 because of the 7 cells, sofar no problem, but I need to keep that range of 7 cells, but sometimes the will only be 5 cells filled withe numbers, an than I still need to know the average of those numbers. But now it has to divid by 5.
How can i create a formula that will adapt to the number of filled cells.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
On 2002-02-25 10:50, Marky wrote:
If got an excelsheet with 7 different numbers in 7 cells in each cell one number.
If I want to know the average i'll just use the formula, and all the numbers wil be added and divided by 7 because of the 7 cells, sofar no problem, but I need to keep that range of 7 cells, but sometimes the will only be 5 cells filled withe numbers, an than I still need to know the average of those numbers. But now it has to divid by 5.
How can i create a formula that will adapt to the number of filled cells.

How about:

=SUM(A1:A7)/MAX(1,COUNT(A1:A7))

where A1:A7 is the target range (adapt to suit).
 
Upvote 0
Use =AVERAGE(A1:A7) and be done with it!!!
AVERAGE ignores empty cells.
This message was edited by Mark W. on 2002-02-25 11:01
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

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