Master the IF Function in Google Sheets with Practical Examples

If you still don’t know how to use the IF function in Google Sheets, you’re missing a lot! The IF function can help you to solve diverse challenges that marketers face, hence making your work easier. In this tutorial, you’ll learn how to use it with simple examples to save time and improve your strategy.
Check out this video-tutorial:
Let’s start with overviewing what we will work with.
We have such a table that contains Month, Channel, Customer type and Transaction Revenue columns.
IF function
IF function is one of the most basic but also one of the most powerful formulas due to its versatility.
How it works
The scheme of the formula is very simple:
=IF(logical_expression, value_if_true, value_if_false)
So, if we, based on the table, want to check if the cell B2 contains the text “Email”, and if this statement is right – return 1, or if it’s wrong – return 0, we write the formula:
=IF(B2=”Email”, 1, 0)
If we take a look at the table, we will notice that the cell B2 contains the text “Paid Social”. Consequently, the result returned will be 0. But if we apply the same formula but to the cell B3, the result will be 1!
Substituting the word for the cell
Let’s create one more column called Channel that would contain the unique channels titles.
Now, we can substitute the word “Email” we were using in the previous example for a cell from the unique titles list.
Instead of 1 and 0, we can use the words, for instance, “yes” and “no” – the values if true or false don’t necessarily have to be numeric.
Using cells as values
I’ve created 2 more columns – The column I (with the new name for the Channel), and the Channel E where we will test the formula.
What are we doing here?
We create a condition: if the cell B2 equals the cell H2, then use the word Paid (cell I2), if not – leave it as it used to be.
As a result, only the cells containing “Paid Social” were affected by this formula.
Using IF formula as a value
I tell you, it’s not as difficult as it may seem! We just write an additional condition. In general the formula can be verbalized like this:
if the cell B2 equals the cell H2, then use the word Paid (cell I2), if not, check whether the cell contains the text “Paid Search” (H5), then use the cell I5, if not – leave it as it used to be.
=if(B2=$H$2,$I$2,if(B2=$H$5,$I$5,B2))
*$ signs are blocking the cell
Here is the result of applying the formula to the whole column!
Conclusion
The IF function in Google Sheets is a simple yet powerful tool that helps marketers perform various tasks easier, quicker and more effectively.
Before we also published articles about IFS function and AND function in Google Sheets. Check them out!
Hope this article was interesting and useful for you – don’t hesitate to ask your questions and leave your impressions in the comments section!
Leave a Reply