Description Usage Arguments Value Examples
It acts similiarly to Excel's AVERAGEIFS function. It calculates the average of the values where several criterias are met(it mimics and expression for criterias).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | AVERAGEIFS(
average_range,
criteria_range1,
criteria1,
criteria_range2 = TRUE,
criteria2 = TRUE,
criteria_range3 = TRUE,
criteria3 = TRUE,
criteria_range4 = TRUE,
criteria4 = TRUE,
criteria_range5 = TRUE,
criteria5 = TRUE,
criteria_range6 = TRUE,
criteria6 = TRUE,
criteria_range7 = TRUE,
criteria7 = TRUE,
criteria_range8 = TRUE,
criteria8 = TRUE,
criteria_range9 = TRUE,
criteria9 = TRUE,
criteria_range10 = TRUE,
criteria10 = TRUE
)
|
average_range |
Give this function a range for it to average on. So first it evaluates range argument based on criteria and it averages the numbers that meet the criteria. |
criteria_range1, criteria_range2, criteria_range3, criteria_range4, criteria_range5, criteria_range6, criteria_range7, criteria_range8, criteria_range9, criteria_range10 |
Give this function a criteria_range/ranges so it can check the range for the appropriate criteria. criteria_range1 is checked against criteria1 |
criteria1, criteria2, criteria3, criteria4, criteria5, criteria6, criteria7, criteria8, criteria9, criteria10 |
Give this function a criteria so it can check the appropriate criteria_range for it. criteria1 for criteria_range1 |
In this example we average Sepal Width of virginica species who have petal width less than 2. Function will always return numeric class.
1 | AVERAGEIFS(iris$Sepal.Width,iris$Species,"virginica",iris$Petal.Width,"<2")
|
extract_numeric() is deprecated: please use readr::parse_number() instead
[1] 2.790476
Warning messages:
1: In AVERAGEIFS(iris$Sepal.Width, iris$Species, "virginica", iris$Petal.Width, :
NAs introduced by coercion
2: In AVERAGEIFS(iris$Sepal.Width, iris$Species, "virginica", iris$Petal.Width, :
NAs introduced by coercion
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.