a) =IFERROR(2.ROUND(1.AVERAGEIF([CODE];"="&[@CODE];[Classification]);1);"");
b) =IFERROR(2.ROUND(1.AVERAGEIF([CODE];"="&[@CODE];[Classification]);1);"");
These formulas are a nested IFERROR, ROUND, and AVERAGEIF functions that calculates the average of the values in the column Classification of the table where the value in the column CODE is equal to the value in the current row of the column CODE.
The result is rounded to one decimal place. If there are no such cells, it returns an empty string.
Here’s how the formula works in formula a) :
AVERAGEIF (range, criteria, average_range)
"Averageif" can be used with only one condition
At our table:
"Average by article" or "Average" |
---|
1,16 |
AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)
"Averageifs" can be used with several conditions. In this case was just one.
At our table:
"Average by article" or "Average" |
---|
1,16 |
ROUND(number, num_digits)
It rounds the result to one decimal place.
At our table:
"Average by article" or "Average" |
---|
1 |