Learn R Programming

ExcelFunctionsR (version 0.1.4)

SUMIF: Basic SUMIF function from excel

Description

It acts similiarly to Excel's SUMIF function. It sums the values where certain criterias are met.

Usage

SUMIF(range, criteria, sum_range)

Arguments

range

Which range should it check the criteria against.

criteria

what criteria should it check in range

sum_range

Which range should it sum

Value

In this case we are summing Sepal length of species which are virginica. Function will always return numeric class.

Examples

Run this code
# NOT RUN {
SUMIF(iris$Species,"virginica",iris$Sepal.Length)
# }

Run the code above in your browser using DataLab