I'm trying to average a range but only if one condition is true.
A B C
1: A 1 2
2: B 3 4
3: C 5 6
4: D 7 8
5: A 1 6
6: E 8 9
7: E 5 8
What I want is if the char I'm looking for is "A" then I want my average to produce something to the form of:
(1/2 + 1/6) /2
=AVERAGEIF(A:A, "="&SomeOtherVariable, B:B/C:C)
I want to avoid creating an extra column because the sheet that this data is on is taken from a google form and I am not sure how the form will take having a new column added to it.
Best Answer
Short answer
Instead of AVERAGEIF use an array formula as AVERAGEIF requires a range as it's third parameter.
Explanation
The below formula could be used to calculate the average for each category without having to use an auxiliary column and as it use open ended references, it will not require to be modified when new form responses be submitted.
Using the example source data provided by the OP, the result is the following:
{'Sheet1'!A:A,'Sheet1'!B:B/'Sheet1!C:C}
creates an array with two columns, the first one is the category column, the second calculates the dividend of Column B divided by Column C.References