Google Sheets EQ Function: How to Compare Values
In this article
The EQ function in Google Sheets checks whether two values are exactly equal and returns TRUE or FALSE. It is the function form of the = operator, so =EQ(A1, B1) gives the same result as =A1=B1. Use it when you want a readable comparison inside a formula, especially when combined with IF, ARRAYFORMULA, or conditional formatting. Nothing needs to be installed or enabled first; EQ is a built-in function available in every Google Sheets spreadsheet.
What You'll Need
- A Google account with access to Google Sheets (the free web version or the mobile app).
- A spreadsheet with at least two values you want to compare, or you can type values directly into the formula.
- Basic familiarity with cell references such as A1 or B2.
Step-by-Step
- Open your spreadsheet at sheets.google.com or in the Google Sheets app. The steps below apply to both desktop and mobile; menu labels can differ slightly by version and region.
- Click an empty cell where you want the TRUE or FALSE result to appear.
- Type an equals sign to start a formula, then type
EQ(. Google Sheets will show a tooltip describing the function and its two arguments. - Enter the first value or cell reference, then a comma. For example,
=EQ(A1, B1)compares the contents of cells A1 and B1. - Enter the second value or cell reference and close the parenthesis. Press Enter (or the checkmark on mobile) to commit the formula.
- Read the result. TRUE means the two values are exactly equal; FALSE means they are not.
- To compare text instead of numbers, wrap the text in double quotes:
=EQ(A1, "Yes"). This returns TRUE only when A1 contains exactly Yes, with no extra spaces. - To use the result in a decision, nest EQ inside IF:
=IF(EQ(A1, B1), "Match", "No match"). This displays a friendly label instead of TRUE or FALSE. - To compare two whole columns row by row, use ARRAYFORMULA:
=ARRAYFORMULA(EQ(A1:A10, B1:B10)). This fills ten results in one step. On mobile, array formulas work the same way but are easier to type on desktop. - To compare against a list of acceptable values, combine EQ with OR:
=OR(EQ(A1, "Red"), EQ(A1, "Blue")). This returns TRUE if A1 matches either colour. - Drag the fill handle (the small square at the bottom-right of the cell) down to copy the formula to other rows. Relative references adjust automatically.
Common Mistakes
- Forgetting that EQ is case-insensitive for text.
=EQ("apple", "Apple")returns TRUE. If you need a case-sensitive comparison, use the EXACT function instead. - Comparing numbers stored as text. A value that looks like 100 but is formatted or imported as text will not equal the number 100. Use VALUE to convert, or check the cell's alignment: text usually sits left, numbers right.
- Leaving stray spaces. "Yes " and "Yes" are not equal. TRIM the cell first:
=EQ(TRIM(A1), "Yes"). - Typing text without quotes.
=EQ(A1, Yes)is read as a named range or error, not the word Yes. Always wrap literal text in double quotes. - Expecting EQ to match partial text. EQ checks the whole value. "App" does not equal "Apple". Use SEARCH or REGEXMATCH for partial matches.
- Using a comma in a region that expects a semicolon. Some locales use semicolons as argument separators. If you see an error, try
=EQ(A1; B1).
Tips
- Use EQ with conditional formatting to highlight matching rows: choose Format > Conditional formatting, pick Custom formula, and enter a formula such as
=EQ($A1, $B1). - EQ returns a Boolean, which Sheets can treat as 1 or 0 in arithmetic.
=EQ(A1, B1)*1gives 1 for TRUE and 0 for FALSE, useful for counting matches with SUM. - For a quick visual check without a formula, select two cells and look at the status bar at the bottom; it shows a count and sum, which helps spot differences in numeric columns.
- EQ is equivalent to the = operator, so use whichever reads more clearly. EQ is often clearer inside longer formulas.
- When comparing dates, remember that dates are stored as numbers.
=EQ(A1, DATE(2024,1,1))is safer than typing the date as text.
Troubleshooting
- Formula returns FALSE when values look identical. Check for trailing spaces with LEN, and check the cell type. Use
=EQ(TRIM(A1), TRIM(B1))to rule out whitespace. - You see #NAME?. The function name is misspelled or the text argument is unquoted. Confirm you typed EQ, not EQ(), and that literal text has double quotes.
- You see #ERROR!. The formula has a syntax problem, often a missing comma or parenthesis. Rebuild it step by step.
- You see #VALUE!. One argument is an invalid type or a range where a single value is expected. EQ compares single values; wrap ranges in ARRAYFORMULA if needed.
- The result is unexpected after copying. Check whether you need absolute references.
=EQ($A$1, B1)locks the first cell so it does not shift when filled down. - Nothing happens when you press Enter. Make sure the cell is not formatted as plain text before you type the formula. Change the format to Automatic or Number and re-enter it.
Frequently Asked Questions
What is the difference between EQ and the = operator?
Nothing in behaviour. EQ(A1, B1) and A1=B1 return the same TRUE or FALSE. EQ is simply a function form that can be easier to read inside nested formulas.
Is EQ case-sensitive?
No. EQ treats "Apple" and "apple" as equal. Use EXACT if case matters.
Can EQ compare more than two values at once?
No, EQ takes exactly two arguments. To compare several values, combine multiple EQ calls with AND or OR, or use COUNTIF.
Why does EQ return FALSE for two numbers that look the same?
One is probably stored as text, or there are hidden spaces or different decimal precision. Convert with VALUE and clean with TRIM, then compare again.
Does EQ work in the Google Sheets mobile app?
Yes. The function is the same on Android and iOS; only the keyboard and formula entry differ.
Can I use EQ in conditional formatting?
Yes. Choose a custom formula rule and enter an EQ formula that refers to the first cell of the range, using absolute references where needed.