I have a spread sheet which, among other things, has a table with a row that specifies the type of problem (put in numbers 0 to 4, according to a reference table) that occurred, and the column next to it says how long it took to be solved. The things is, the problems are not sorted by type, so I can't perform a regular SUM, MEDIAN, etc… on a range. It looks something like this:
Problem type | Time taken
0 | 143
3 | 123
2 | 987
0 | 431
And so on. The options I see are either composing 5 new tables by error type, or make
= function IF (*totalSumRange*; "cellToTheLeft == errorTypeNumber")
kind of statements, but I apparently can't specify such things within the arguments.
Best Answer
You can use
AVERAGEIF
in Google Sheets, per below. (Similarly forSUMIF
.)You can either specify the exact range, as above (
A$2:A$8
), or generalise the parameters toA:A, D2, B:B
. I prefer the latter as the formula doesn't need to be updated when new entries are added to columns A and B. However, this assumes there is no other data further down in columns A and B.For reference, from Google Docs Editors Help: