Average the hard way..

scelba

New Member
Joined
Nov 17, 2011
Messages
4
Looking to for a solution to completely replace the AVERAGE function.
New formula needs to handle blanks and texts as not to use them in the division for the average.

thoughts have been SUMMPRODUCT with -- for count and also trying to use COLUMNS - COUNTA to modify the count for division.

getting stuck putting it all together.. assistance in completing this creative solution would be appreciated.

example input cells to average
=B23 0.85 =C23.84 0.95 =D23 rrr

=AVERAGE($B$23:H23)


works for blanks but not inbetween blanks
=SUM($B$23:H23)/(((SUMPRODUCT(--($B$23:H23<>"")))-((COLUMNS($B$23:H23)-(COUNTA($B$23:H23))))))


will not handle any blanks
=SUM($B$23:E23)/(((SUMPRODUCT(--($B$23:E23<>"")))-((COLUMNS($B$23:E23)-(COUNTA($B$23:E23))))))
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
The AVERAGE function ignores text and blanks. How is this new function going to be different?
 
Upvote 0
ok I think I got it. As a "Replacement" for the AVERAGE formula one could use a SUM divided by a COUNTIF which only counts numbers... not blanks or texts.

=SUM($B$23:E23)/((COUNTIF($B$23:E23,">0")+COUNTIF($B$23:E23,"<0")+COUNTIF($B$23:E23,"=0")))
 
Upvote 0
COUNT only counts numbers so if you need an alternative to AVERAGE this would suffice

=SUM(range)/COUNT(range)
 
Upvote 0
ok I think I got it. As a "Replacement" for the AVERAGE formula one could use a SUM divided by a COUNTIF which only counts numbers... not blanks or texts.

=SUM($B$23:E23)/((COUNTIF($B$23:E23,">0")+COUNTIF($B$23:E23,"<0")+COUNTIF($B$23:E23,"=0")))

Equivalence

AVERAGE(X) º SUM(X)/COUNT(X)
 
Upvote 0

Forum statistics

Threads
1,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

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