How to Combine Logic with the AND Function in Google Sheets

Do you know how to use the AND function in Google Sheets? I am here to explain to you how it works and how it can make your Google Sheets practice significantly easier!
Check out the video tutorial here:
Formula composition
The AND function compares all the conditions and returns the result if it is true or not true. All of the conditions stated in the formula have to be met simultaneously,
The formula looks like this:
=AND(logical_expression1, [logical_expression2, …])
Practical Example 1
Here we have such a table showing date, channel, customer type and transaction revenue.
Let’s use the AND function to check if the data in a cell corresponds to a certain condition.
=AND(B2=”Paid Social”)
The cell B2 in fact contains “Paid Social”, so the returned result will be “TRUE”.
Followingly, we can add one more condition to check the cell C2.
=AND(B2=”Paid Social”, C2=”New”)
However, taking a look at the table, we can see that the C2 cell contains “Returning”, not “New”, so the returned result will be “FALSE”.
Practical Example 2
In the first example we were writing the exact words in the conditions. Meanwhile, you can choose a cell as a condition.
Hence, I created an auxiliary table that will help us with this task.
So let’s change the formula:
=AND(B2=J2, C2=I2)
It will mean that if the channel from column B matches the channel from column J, and the customer type from column C matches customer type from column I, the result will be “TRUE”. If any of these conditions isn’t met, the result will be “FALSE”.
We can also validate the revenue that we have in the first table.
=AND(B2=J2, C2=I2, D2>50000)
If the revenue is bigger than 50000 and the previous conditions are met, the result will be “TRUE”.
Tip: using IF formula
If you don’t want the result to be only TRUE or FALSE, you can use the IF formula.
=IF(AND(B2=J2, C2=I2, D2>50000), “yes”, “no”)
This way, if the logical expression is true, the result will be “yes”, if it’s false, the result will be “no”.
Conclusion
AND function is one of the vital functions to know for the marketers who work with data in Google Sheets. When combined with the other logical functions such as IF, IFS and OR, it reveals a lot of opportunities for data analysis.
Did you like this article? Follow my YouTube channel to be among the first ones to watch the new videos!
By the way, if you haven’t subscribed to my newsletter yet, do it right now and get a Looker Studio template for free!