Forum Discussion
How to exclude specific cells from an AutoSum?
Now, let me ask: how is the data arranged in the first place that would cause you to need to exclude some records? There may be an entirely legitimate reason, but it sounds like there are many things that do belong together, but others that don't. So why are they there in the first place? As I said, maybe a totally valid reason....I'm just curious whether there's an underlying design issue here.
- ElJarrodDec 09, 2019Copper ContributorThe data here are various elements of video content consumption. I have a column for "Content Completion Rate" (Content Completes รท Content Starts) and another for "Avg. Content Time Spent. (Content Time Spent รท Content Starts)."
For the former, the issue occurs when zero "Content Starts" actually occurred. Same thing for the latter. In both cases, the result is a div/0, which is problematic because I'm trying to get an average and quartiles for all the data in these columns.
In the grand scheme, I'd love to never have an instance of zero content starts! Hopefully this whole exercise helps me get to that point.- mathetesDec 09, 2019Silver Contributor
So in those rows where there's a zero divisor,ElJarrod , you could use the formula (edited, obviously, for real references) =IF(DivisorCell=0,"",NumeratorCell/DIvisorCell)
Then the cell that would otherwise have an error will be left totally blank, and not figured in with the average of the whole column.
That would be preventive action rather than contingent, always preferable.
And, of course, longer term (is this a streaming service of some kind?)...you want there never to be zero starts, etc. ๐๐
- ElJarrodDec 10, 2019Copper Contributor
That formula is exactly the kind of thing I was looking for - thank you,
But what would the proper format be if I'm combining that =IF() with something like the following:
=QUARTILE(J2:J296, 3)
And long-term, you're 100 percent correct -- we never want zero starts. I've obviously discovered something that's either broken and/or ineffective. Which, frankly, is the purpose of this whole endeavour.
- ElJarrodDec 07, 2019Copper Contributor
mathetes Thanks for recommending AVERAGEIFS, that will come in handy.
To answer your question, the reason I was trying exclude specific cells is because I had some div/0 things happening that were making it so my AutoSum Average, Median, and Quartiles weren't working. I realized there were very few instances of div/0 though, so I just manually turned them into zeros and the functions calculated out correctly.
- mathetesDec 07, 2019Silver Contributor
ElJarrod Wyn's suggestion is a better one than turning those error messages into zero--doing that will distort (perhaps only slightly) the averages that result.
If possible though (and maybe it's just not that important), it would be better overall to deal with the underlying problem and eliminate those DIV/0 errors to begin with.
- Wyn HopkinsDec 07, 2019MVP
You can also use AGGREGATE to ignore errors = AGGREGATE(1,6, A1:A10) will Average and Ignore errors
Cheers
Wyn