Google Sheets ISLOGICAL Function: Usage and Examples
In this article
The ISLOGICAL function in Google Sheets checks whether a value is a Boolean value (TRUE or FALSE). It returns TRUE if the cell contains a logical value and FALSE if the cell contains any other type of data, such as text, a number, or a date. This is primarily used to validate data and ensure that formulas relying on logical switches are receiving the correct input type.
What You'll Need
- A Google account with access to Google Sheets.
- A dataset containing a mix of values (text, numbers, and logical TRUE/FALSE results) to test the function.
Step-by-Step
- Open your spreadsheet: Launch Google Sheets and open the document where you want to verify logical values.
- Identify the target cell: Locate the cell you want to test. For example, if you have a column of checkboxes or the results of an
=A1>10formula, these are logical values. - Enter the function: Click on an empty cell where you want the result to appear. Type
=ISLOGICAL(. - Select the reference: Click on the cell you are testing (e.g., cell A2) or type the cell reference manually. Your formula should now look like
=ISLOGICAL(A2). - Complete the formula: Type the closing parenthesis
)and press Enter. - Interpret the result:
- If the cell shows TRUE, the referenced cell contains a logical TRUE or FALSE.
- If the cell shows FALSE, the referenced cell contains something else (like the word "True" written as text, a number, or is empty).
- Apply to multiple cells: Click the small blue square (fill handle) at the bottom-right corner of the cell containing the formula and drag it down to apply the check to the rest of your column.
Common Mistakes
- Confusing Text with Logicals: A common error is thinking that the word "TRUE" typed as text is a logical value. If a cell contains
'TRUE(with an apostrophe) or is formatted as plain text, ISLOGICAL will return FALSE because it is treating the entry as a string of characters, not a Boolean state. - Testing Empty Cells: An empty cell is not a logical value. ISLOGICAL will return FALSE for blank cells.
- Over-complicating the Argument: ISLOGICAL only takes one argument. Attempting to add multiple ranges or criteria inside the parentheses will result in a formula error.
- Assuming it returns the value of the cell: Remember that ISLOGICAL does not tell you if the value is true; it tells you if the value is a logical type. To check if a value is specifically TRUE, simply use
=A2=TRUEor just=A2.
Tips
- Combine with IF: Use ISLOGICAL inside an IF statement to create a safety net for your data. For example:
=IF(ISLOGICAL(A2), "Valid Logic", "Invalid Data"). This helps flag cells that should be checkboxes but were typed in as text. - Checkbox Validation: Since checkboxes in Google Sheets are essentially visual representations of TRUE and FALSE, ISLOGICAL is the perfect tool to verify that a column consists entirely of checkboxes.
- Data Cleaning: Use this function to find "pseudo-logicals" in imported data. If you import a CSV where TRUE/FALSE values were converted to text, ISLOGICAL will return FALSE, alerting you that you need to convert those strings back into Boolean values.
Troubleshooting
If the function is not behaving as expected, try these steps:
- Check for quotes: Look at the cell you are testing. If the value is wrapped in quotation marks (e.g., "TRUE"), Google Sheets treats it as text. Remove the quotes to make it a logical value.
- Verify cell formatting: Go to Format > Number and ensure the cell is set to "Automatic." If it is explicitly set to "Plain Text," the logical value may be treated as a string.
- Check for hidden spaces: A cell containing "TRUE " (with a trailing space) is text, not a logical value. Use the
=TRIM()function to remove extra spaces if you suspect this is the issue. - Formula Error: If you see a
#N/Aor#ERROR!, check that you have closed the parentheses and that you are not referencing a range (like A1:A10) inside a single ISLOGICAL function without using an ArrayFormula.
Frequently Asked Questions
Does ISLOGICAL work with checkboxes?
Yes. Checkboxes in Google Sheets are stored as TRUE (checked) and FALSE (unchecked), so ISLOGICAL will always return TRUE for a cell containing a checkbox.
What is the difference between ISLOGICAL and the IF function?
ISLOGICAL checks the type of data (is it a Boolean?), whereas IF evaluates the value of the data to decide which result to return.
Will ISLOGICAL return TRUE for the number 1 or 0?
No. In Google Sheets, the numbers 1 and 0 are numeric values, not logical values. ISLOGICAL will return FALSE for these cells.
Can I use ISLOGICAL with an ArrayFormula?
Yes. If you want to check an entire column at once, you can use =ARRAYFORMULA(ISLOGICAL(A2:A100)) to get a list of TRUE/FALSE results for the entire range.
Why does ISLOGICAL return FALSE for a cell that says TRUE?
This usually happens because the cell is formatted as text or contains a leading apostrophe, meaning Google Sheets sees it as a word rather than a logical state.