Is there an Aggregate function to get an Average of A1:A99 for example that will ignore 0's and Hidden Rows. I can get it to work just ignoring Hidden Rows but can't figure out how to Ignore 0's
=AGGREGATE(1,7,G4:G103) - Here's what I have now
Is there an Aggregate function to get an Average of A1:A99 for example that will ignore 0's and Hidden Rows. I can get it to work just ignoring Hidden Rows but can't figure out how to Ignore 0's
=AGGREGATE(1,7,G4:G103) - Here's what I have now
Hi,
It would have been useful if Microsoft had included an option to exclude zeroes within the options parameter.
Since they didn't, the standard workaround is a volatile array formula**:
=AVERAGE(IF(SUBTOTAL(103,OFFSET(G4,ROW(G4:G103)-MIN(ROW(G4:G103)),)),IF(G4:G103<>0,G4:G103)))
A non-volatile alternative is this triple-AGGREGATE set-up:
=AGGREGATE(9,7,G4:G103)/SUMPRODUCT(N(AGGREGATE(14,7,G4:G103,ROW(INDEX(A:A,1):INDEX(A:A,AGGREGATE(3,7,G4:G103))))<>0))
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
Array formula
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks