average of absolute values if some cells are left blank.

GertG

New Member
Joined
Feb 18, 2014
Messages
2
Hello,


I have a small problem,
An array of cells contains number, negative or positive. Although some cells are left blank in the array. Which cells are blank and which ones aren't vary depending on previous input.
I would like to take the average of the absolute values of the number in the cells. The cells that are blank in the array should be completely ignored.

I was thinking of something like this:
=SUMPRODUCT(ABS(A6:A161))/COUNT(A6:A161)

Although the ABS function doesn't work properly if some of the cells are blank. So there should be something within ABS that checks if the cells contain a number, although i don't know how to do this over an array and still get this to work.


I hope you can help,
Gert
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
This CSE formula worked for me, but I suspect there is a slicker way of doing it.
=SUM(IF(A1:A9="","x",ABS(A1:A9)))/COUNT(A1:A9)
 
Upvote 0
This CSE formula worked for me, but I suspect there is a slicker way of doing it.
=SUM(IF(A1:A9="","x",ABS(A1:A9)))/COUNT(A1:A9)


Doesn't seem to be working for me. It appear that the IF clause only takes the first cell in the array and then there is just a sum of the first cell. The COUNT part does its job off course. At least that's the cast down at my end.


Sincerely,
Gert
 
Upvote 0
Hi Gert
Welcome to the board

Try:

=AVERAGE(IF(ISNUMBER(A6:A161),ABS(A6:A161)))

This is an array formula, you have to confirm it with CTRL-SHIFT-ENTER and not just ENTER.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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