Average Negatives and ignore 0

The Animal

Active Member
Joined
May 26, 2011
Messages
449
Hi
I have a range of cells Q5,V5,AA5,AF5 etc that are all negative values but some are zero or blank.
I need a formula that gives me an average of the selected cells but ignoring the zero or blank cells in the averaging.

Any help would be great

Thanks Stephen
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try this formula

=IFERROR(SUM( Q5,V5,AA5,AF5)/((Q5<0)+(V5<0)+(AA5<0)+(AF5<0)),"")
 
Last edited:
Upvote 0
Thanks so much Barry.
There is a number of cells used in the calculation which are each 4th cell (G5,V5,AA5,AF5 etc) starting at Q5 and finishing at JL5.
Is there a way where the formula can use each 4th cell from Q5:JL5 instead of having to include each cell ((Q5<0)+(V5<0)+(AA5<0)+(AF5<0)) etc in the formula?
Thanks again Stephen
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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