0% found this document useful (0 votes)
24 views3 pages

Functions With Multiple Conditions

Uploaded by

Jay Yul Gaara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Functions With Multiple Conditions

Uploaded by

Jay Yul Gaara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Functions with multiple conditions

In this reading, you will learn more about conditional functions and how to construct functions
with multiple conditions. Recall that conditional functions and formulas perform calculations
according to specific conditions. Previously, you learned how to use functions like SUMIF and
COUNTIF that have one condition. You can use the SUMIFS and COUNTIFS functions if
you have two or more conditions. You will learn their basic syntax in Google Sheets, and check
out an example.

Refer to the resources at the end of this reading for information about similar functions in
Microsoft Excel.

SUMIF to SUMIFS
The basic syntax of a SUMIF function is: =SUMIF(range, criterion, sum_range)

The first range is where the function will search for the condition that you have set. The criterion
is the condition you are applying and the sum_range is the range of cells that will be included in
the calculation.

For example, you might have a table with a list of expenses, their cost, and the date they
occurred.

Column A: A1 - Expense A2 - Fuel A3 - Food A4 - Taxi A5 - Coffee A6 - Fuel A7 - Taxi A8 - Coffee


A9 - Food Column B: B1 - Price B2 - $48.00 B3 - $12.34 B4 - $21.57 A5 - $2.50 A6 - $36.00 A7 -
$15.88 A8 - $4.15 A9 - $6.75 Column C: C1 - Date C2 - 12/14/2020 C3 - 12/14/2020 C4 -
12/14/2020 C5 - 12/15/2020 C6 - 12/15/2020 C7 - 12/15/2020 C8 - 12/15/2020 C9 - 12/15/2020
You could use SUMIF to calculate the total price of fuel in this table, like this:
But, you could also build in multiple conditions by using the SUMIFS function. SUMIF and
SUMIFS are very similar, but SUMIFS can include multiple conditions.

The basic syntax is: =SUMIFS(sum_range, criteria_range1, criterion1,


[criteria_range2, criterion2, ...])

The square brackets let you know that this is optional. The ellipsis at the end of the statement lets
you know that you can have as many repetition of these parameters as needed. For example, if
you wanted to calculate the sum of the fuel costs for one date in this table, you could create a
SUMIFS statement with multiple conditions, like this:

This formula gives you the total cost of every fuel expense from the date listed in the conditions.
In this example, C1:C9 is our second criterion_range and the date 12/15/2020 is the second
condition. As long as you follow the basic syntax, you can add up to 127 conditions to a
SUMIFS statement!

COUNTIF to COUNTIFS
Just like the SUMIFS function, COUNTIFS allows you to create a COUNTIF function with
multiple conditions.

The basic syntax for COUNTIF is: =COUNTIF(range, criterion)

Just like SUMIF, you set the range and then the condition that needs to be met. For example, if
you wanted to count the number of times Food came up in the Expenses column, you could use a
COUNTIF function like this:

COUNTIFS has the same basic syntax as SUMIFS: =COUNTIFS(criteria_range1,


criterion1, [criteria_range2, criterion2, ...])

The criteria_range and criterion are in the same order, and you can add more conditions to the
end of the function. So, if you wanted to find the number of times Coffee appeared in the
Expenses column on 12/15/2020, you could use COUNTIFS to apply those conditions, like this:

This formula follows the basic syntax to create conditions for “Coffee” and the specific date.
Now we can find every instance where both of these conditions are true.

For more information


SUMIFS and COUNTIFS are just two examples of functions with multiple conditions. They help
demonstrate how multiple conditions can be built into the basic syntax of a function. But, there
are other functions with multiple conditions that you can use in your data analysis. There are a
lot of resources available online to help you get started with these other functions:

 How to use the Excel IFS function: This resource includes an explanation and
example of the IFS function in Excel. This is a great reference if you are interested in learning
more about IFS. The example is a useful way to understand this function and how it can be used.
 VLOOKUP in Excel with multiple criteria: Similar to the previous resource, this
resource goes into more detail about how to use VLOOKUP with multiple criteria. Being able to
apply VLOOKUP with multiple criteria will be a useful skill, so check out this resource for more
guidance on how you can start using it on your own spreadsheet data.
 INDEX and MATCH in Excel with multiple criteria: This resource explains how
to use the INDEX and MATCH functions with multiple criteria. It also includes an example
which helps demonstrate how these functions work with multiple criteria and actual data.
 Using IF with AND, OR, and NOT functions in Excel: This resource combines
IF with AND, OR, and NOT functions to create more complex functions. By combining these
functions, you can perform your tasks more efficiently and cover more criteria at once.

You might also like