How to Use the If Function in Google Sheets


One of the most valuable features of Google Sheets is the “YES” feature.

Imagine that you want to be able to quickly scan your spreadsheet and answer some key questions. This feature will help you do just that.

→ Sign in now: Google Spreadsheets Templates [Free Kit]

Let’s see how it works and see some real life examples.

What does the if function do in Google Sheets?

In Google Sheets, the if function allows you to check a condition and return a specific value if TRUE.

For example, suppose you have three columns in a spreadsheet: channel, goal, and profit. Want to know which channels are more profitable than your goal.

You can use the YES function to do this: the logical formula would be this way: if the goal is higher than the profit, it will return “YES”. If not, it will return a “NO”. You can then track this data in another column entitled “Goal Achieved.”

How to use If Function in Google Sheets

When using the if function in Google Sheets, you must use the following syntax:

IF (logical_expression, value_if_true, value_if_false)

Let’s break down what each one means:

  • Logical expression refers to the condition you are checking on the function.
  • Value if true is the value that the function will return if the logical expression is true.
  • Value if false is the value that the function will return if the logical expression is false.

To do this, you must use the following logical expression symbols:

  • > to indicate greater than
  • > = to indicate equal to or greater than
  • < to indicate greater than
  • <= to indicate equal to or less than
  • <> to indicate not equal
  • = to indicate the same

Let’s look at a real life example.

Excel spreadsheet showing four columns: channel, goal, profit, goal achieved with data rows

Here is a spreadsheet with data on the performance of each marketing channel. Each channel had a revenue target alongside the actual profit. The last column, “Goal Achieved” will be used to quickly answer which channels have achieved the goal.

  1. Select the cell where the formula will be applied.

  2. Type the formula following this syntax:how to write the formula of the if function in your cell: type the formula following this syntax:

  3. Drag your mouse to apply the formula to the relevant cells.

Are you afraid of forgetting? Do not you worry. Google Spreadsheets has an autofill feature that will show you the formula as you type it.

how to write the formula for the if function in your cell: Drag the mouse to apply the formula to the relevant cells.

In this case, the formula will be: = yes (C2> B2, “YES”, “NO”). To break it down further, the formula indicates whether the benefit of the email channel outweighs the target profit, and then type “YES.” If it is lower, type “NO”.

breaking down the formula of the if function

Note that the value if true may be the one you choose. However, in this example, the easy option was to choose the words “YES” or “NO”.

Because the formula includes words, you must use apostrophes so that Google Sheets reads the formula correctly.

Functions Yes / Then Vs. Si / I vs. Si / O

In the simplest terms, with “If-Then” check that a condition is met. In the example above, one value would be higher than the other. Based on this data, the return value would be “YES” or “NO”.

With “If And”, you are checking various conditions for a “TRUE” value. All must be “TRUE” for the return value to be “TRUE”.

“If O” is the exact opposite of “Yes and”. It also verifies several conditions, but if any are true, it will return a “TRUE” value.

Here’s a real-world example:

  • If then I go to the store. If you go to the store, the statement is true.
  • If i I go to the store and fill the tank. You must go to the store and fill out your deposit for the statement to be true. Otherwise, it will be false.
  • Si oI go to the store and fill the tank. You can complete any of the tasks and the statement will be true. The only time it will be false if you do not complete any of them.

How to use the If function with multiple conditions

Suppose you are conducting a survey and want to easily classify your respondents into two age groups. You can write a formula that indicates that if respondents are 25 years of age or younger, they will be in group “A”. If they are 26 or older, they will be in Group B.

This creates multiple conditions under which the value can be written. The formula checks the first condition, if it does not apply, goes to the next to find the right value.

Let’s see it in action.

nested if Google Spreadsheet works

Using the example above, your formula would be as follows:

= SI (A2 < = 25; "A", SI(A2 >= 25; “B”))

example of nested if function in Google Sheets

If function nested in Google Sheets

In Google Spreadsheets, “nesting” refers only to placing the “yes” function within its own formula to test several conditions and return different results based on these tests.

The syntax of the formula is as follows:

= YES (first_declaration, value_if_true, YES (second_declaration, value_if_true, value_if_false))

It’s as easy as that.

So here’s another feature you can use to speed up your process when using Google Spreadsheets.

Google Business Sheet Templates



Source link

Leave a Reply