IF | CSE 148 – Excel Exam 1

Still feeling nervous for your exam? Check out the Excel Cram Kit (Exam 1) for practice modules that emulate the difficulty that you'll face on your exam. Each module includes a thorough step-by-step explanation where I walk you through the entire problem solving process!

IF explained

For any The Office fans out there, fasten your seatbelts. It's time for the C.R.I.M.E.A.I.D. (Crime Reduces Innocence Makes Everyone Angry I Declare) fundraising event!

(I do not own this image. Rights to The Office and YouTube for this image. Educational purposes only.)

In this episode of The Office, Dunder Mifflin gets broken into and robbed, prompting Michael to plan an auction to raise money for the stolen items. His goal: $1,000,000.

If Michael had set up an Excel sheet with all these items, it might look something like this:

We can use an IF function in F2 to determine whether or not Michael meets his $1,000,000 goal!

If his goal is met, this cell will display "YES". If his goal has not been met yet, this cell will display "NO".

IF functions determine whether or not a condition is met, then assume a value depending on if the condition is true or false.

Coding an IF function

To code the C.R.I.M.E.A.I.D. IF function, let's first view the template for IF functions:

=IF(logical_test, [value_if_true], [value_if_false])

The logical_test is where we'll be determining whether or not we've reached the $1,000,000 goal. Keep in mind, this is the condition that we discussed earlier.

In our case, the condition is whether or not the sum of all donations (in column C) totals $1,000,000 or above. Therefore, we can write our logical_test like so:

=IF(SUM(D:D) >= 1000000, [value_if_true], [value_if_false])

If this sum reaches or exceeds $1,000,000, then the [value_if_true] must be displayed. What should this be? Remember what we said earlier...

If his goal is met, this cell will display 'YES'. If his goal has not been met yet, this cell will display 'NO'.

Therefore, we'll place the following in our IF function:

=IF(SUM(D:D) >= 1000000, "YES", [value_if_false])

Now for our [value_if_false] value...

If his goal is met, this cell will display 'YES'. If his goal has not been met yet, this cell will display 'NO'.

So, we'll place "NO" in our function for [value_if_false].

=IF(SUM(D:D) >= 1000000, "YES", "NO")

When we plug this into Excel, we get "NO" as a result.

Poor Michael hasn't met his fundraising goal yet! Let's bid up on Phyllis' hug to cheer him up.

Other comparison operators

We just used the ">=" comparison operator...

=IF(SUM(D:D) >= 1000000, "YES", "NO")

...but there are more that we can use in our logical_test. Here are the most popular ones:

OperatorDescriptionExample (num = 1)
=__ equals __"num = 1"
TRUE. "1 equals 1" is a true statement.
<>__ does not equal __"num <> 1"
FALSE. "1 does not equal 1" is a false statement.
>__ is greater than __"num > 0"
TRUE. "1 is greater than 0" is a true statement.
<__ is less than __"num < 0"
FALSE. "1 is less than 0" is a false statement.
>=__ is greater than or equal to __"num >= 2"
FALSE. "1 is greater than or equal to 2" is a false statement.
<=__ is less than or equal to __"num <= 1"
TRUE. "1 is less than or equal to 1" is a true statement.

Check out the practice problem below for some practice using different comparison operators!

Practice Problem

In the following Excel sheet, display whether or not Robert has more or less of an allowance than Shaun in cell B3.

If Robert's allowance is less than Shaun's, display "Robert has less". If that condition is not true, display "Robert has more".

=IF(B1<B2, "Robert has less", "Robert has more")

Answer: "Robert has more"

Excel (Exam 1) Follow-along Guide

It's no secret you retain info better when you write it down. That's why I created the Excel (Exam 1) Follow-along Guide for you!

As you come upon key concepts highlighted in yellow, like this sentence here, you can fill-in-the-blanks on your Follow-along Guide so that you remember all the important stuff for later!

You can obtain the Excel (Exam 1) Follow-along Guide for FREE by entering your email below!

Next, let's learn about the percent change formula and how to use it!

Free Resources

Each exam concept broken down in simple, real-world examples!

ToolsExcel (Exam 1) Follow-along Guide
LessonSUM & AutoSUM
LessonRelative vs. Absolute Cell References
LessonPercent change
LessonExcel charts
LessonImporting text files

Practice Problems

Step-by-step walkthrough for each of the questions you need to be ready for!

"I bought this Cram Kit the night before my exam, and it helped me tremendously. It provides step-by-step explanations for all the units covered in class."

Matt Lamanna
Oct. 24, 2021

Rating: 5 out of 5.

Leave a Comment