How can I create a simple formula in Google Sheets to check if a cell contains a specific value? 2

How can I create a simple formula in Google Sheets to check if a cell contains a specific value?

Creating a simple formula in Google Sheets to check if a cell contains a specific value can be done by using the IF function. This function allows you to set a condition and specify the action to be taken if the condition is met. By using the IF function with the CONTAINS function, you can check if a cell contains a specific value and return a desired result. This formula is useful for sorting and organizing data in your Google Sheets spreadsheet. By following the proper syntax and using the correct functions, you can easily create a formula to check for specific values in cells.

Google Sheets: A Simple Formula for “If Contains”


You can use the following formula in Google Sheets to determine if a cell contains a certain string:

=IF(REGEXMATCH(B1,"this"),1,0)

In this example, if cell B1 contains the string “this” then it will return a 1, otherwise it will return a 0.

The following examples show how to use this formula in practice.

Example 1: Use “If Contains” For One String

The following formula shows how to create a new column that returns a 1 if the team name is equal to Lakers and a 0 if the team name is not equal to Lakers:

Note that you can also return string values such as “Yes” or “No” instead of numeric values:

Example 2: Use “If Contains” For One of Several Strings

The following formula shows how to create a new column that returns a 1 if the team name is equal to Lakers or Mavericks and a 0 if the team name is something else:


You can find more Google Sheets tutorials on .

Cite this article

stats writer (2024). How can I create a simple formula in Google Sheets to check if a cell contains a specific value?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-create-a-simple-formula-in-google-sheets-to-check-if-a-cell-contains-a-specific-value/

stats writer. "How can I create a simple formula in Google Sheets to check if a cell contains a specific value?." PSYCHOLOGICAL SCALES, 29 Apr. 2024, https://scales.arabpsychology.com/stats/how-can-i-create-a-simple-formula-in-google-sheets-to-check-if-a-cell-contains-a-specific-value/.

stats writer. "How can I create a simple formula in Google Sheets to check if a cell contains a specific value?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-create-a-simple-formula-in-google-sheets-to-check-if-a-cell-contains-a-specific-value/.

stats writer (2024) 'How can I create a simple formula in Google Sheets to check if a cell contains a specific value?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-create-a-simple-formula-in-google-sheets-to-check-if-a-cell-contains-a-specific-value/.

[1] stats writer, "How can I create a simple formula in Google Sheets to check if a cell contains a specific value?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, April, 2024.

stats writer. How can I create a simple formula in Google Sheets to check if a cell contains a specific value?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top