I had another idea. Perhaps you could use another row that checks if the value is non-zero, and sets its flag as 1 for positive or 0 for not, then sum them to get the denominator for the average... I tested it out in excel, it works well enough if that is your goal.