In Excel, 1 is treated as TRUE when it is used in a logical context, and TRUE converts to 1 when Excel needs a number. The value 1 itself is not the word TRUE: 1 is a number, and TRUE is a logical value. Excel simply coerces between them, where TRUE equals 1 and FALSE equals 0. So =IF(1,"yes","no") returns "yes" because any nonzero number counts as true, while =IF(0,"yes","no") returns "no". The reverse direction matters just as much: =TRUE+0 returns 1, =FALSE+0 returns 0, and =A1*1 turns a checkbox TRUE into 1.
The confusion comes from two different things being called "1": the numeric value one, and the logical value TRUE that Excel stores internally as 1. Once you know which one a formula expects, most surprising results stop being surprising.
What You'll Need
- Excel on Windows, Mac, or Excel for the web (menu labels can differ slightly by version, platform and region)
- A blank sheet for testing formulas, or a file where you want to convert Boolean values to numbers or the other way around
- The cell values you are checking formatted sensibly, so a number is not accidentally stored as text
Step-by-Step
- Test the behavior directly. In an empty cell type
=1=TRUEand press Enter. Excel returns TRUE, confirming that the number 1 and the logical value TRUE are considered equal in a comparison. Type=0=FALSEand you get TRUE as well. - See what a formula returns. Type
=TRUEin one cell and=FALSEin another. Both display in capitals and are right-aligned like numbers, which is a visual hint that Excel stores them as 1 and 0. Compare that with typing the word TRUE without an equals sign: Excel may treat it as text, depending on whether auto-correction or imported data is involved. - Convert TRUE/FALSE to 1/0. In the next column, use one of three reliable methods:
•=A1*1— multiply by one
•=--A1— the double minus, called a double unary, flips nothing and leaves 1 or 0
•=N(A1)— the N function converts TRUE to 1 and FALSE to 0
All three are simple and safe. Choose one and stay consistent across the workbook so other users can follow it. - Convert 1/0 back to TRUE/FALSE. Wrap the number in a comparison:
=B1=1returns TRUE when B1 is 1 and FALSE when B1 is 0. Or use=IF(B1=1,TRUE,FALSE)if you want the result to be unmistakably logical rather than a number. - Understand what IF actually tests. Excel's
IFfunction treats any nonzero number as TRUE. So=IF(5,"a","b")returns "a", and=IF(-2,"a","b")also returns "a". Only 0 is false. This is why a formula like=IF(COUNT(A1:A5),"has values","empty")works: the count is 0 when the range is empty and any positive number otherwise. - Check how checkboxes and form controls behave. A linked checkbox cell returns TRUE or FALSE by default, which sums and multiplies as 1 and 0. If a cell is set to show the value as a number instead, it will show 1 and 0. To count ticked boxes, use
=COUNTIF(range,TRUE)or=SUM(range)when the values are numeric. - Confirm with a sum test. Type
=TRUE+TRUEand press Enter. The result is 2, which proves Boolean values add as numbers.=TRUE*10returns 10 and=FALSE*10returns 0. This is the fastest way to verify the coercion on your own copy of Excel. - Watch for the text-versus-logic trap. If a cell contains the text string "TRUE" (for example, pasted from a CSV),
=A1=TRUEreturns FALSE because text is not the logical value. Use=UPPER(TRIM(A1))="TRUE"to test text, or clean the data by retyping with an equals sign, using the Text to Columns feature, or converting with a formula.
Common Mistakes
- Assuming TRUE always equals 1 in comparisons with text.
="1"=TRUEreturns FALSE. The text "1" is not the number 1, and neither is the logical TRUE. - Expecting SUMPRODUCT or SUM to add logical ranges without coercion. SUM ignores TRUE and FALSE in some ranges, while SUMPRODUCT treats them as 1 and 0 in array math. If a total looks wrong, coerce the values with
--or*1. - Confusing the displayed value with the stored value. A cell showing 1 may actually be the logical TRUE formatted as a number, or the text "1". Check with
=ISTEXT(A1)and=ISLOGICAL(A1)to identify the real type. - Using quotation marks around logic.
="1"is text;=1is a number. That one pair of quotes changes every downstream result. - Relying on nonzero numbers as equivalents of TRUE in SUMIF criteria. Criteria like
">0"behave as expected, but criteria ofTRUEonly match actual logical values.
Tips
- Use
=CELL("type",A1)to see whether a cell is stored as a logical value ("b"), a number ("v"), or text ("l") when debugging. - When exporting to CSV, TRUE and FALSE usually become 1 and 0, which is expected and useful for importing into other systems.
- For large workbooks, coerce once in a helper column rather than repeating
*1throughout formulas; it keeps calculations easier to audit. - Remember that
=IF(A1="",0,A1)can leave an empty string in a lookup, and an empty string is not 0 and not FALSE, which produces odd results in later comparisons. - Keep a small scratch sheet with the test formulas above so you can quickly check how a new Excel version or file behaves before changing production formulas.
Troubleshooting
If =IF(1,"yes","no") is not returning what you expect, first check that the cell does not contain text. A number formatted as text, or a number with a leading apostrophe, is still coerced by IF, but comparison formulas against TRUE may fail. Reformat the cell as General or Number and re-enter the value.
If a SUM or COUNT is off by a small amount, look for Boolean values in the range. SUM over a range of TRUE/FALSE returns 0 in many cases because SUM ignores logical values that arrived as the result of formulas. Use =COUNTIF(range,TRUE) for counting, or coerce the range with =SUMPRODUCT(--range).
If formulas recalculate unexpectedly after an edit, press Ctrl+` (the backtick key) to toggle the Show Formulas view and confirm the formula bar is showing the calculation rather than hardcoded text. Turn it off with the same shortcut.
If a checkbox returns a number instead of TRUE, change the cell format to General, or adjust the linked cell handling in the control. If TRUE is showing as 1 in a cell that should display the word, apply the General or Text format rather than Number.
Frequently Asked Questions
Does Excel treat 1 as TRUE?
In a logical test, yes. Any nonzero number, including 1, is evaluated as TRUE by IF and similar functions, and only 0 counts as FALSE. But the value 1 is still a number, not the logical value TRUE.
Why does =TRUE+0 return 1?
Because Excel converts logical TRUE to the number 1 when arithmetic is performed, and FALSE to 0.
How do I convert TRUE and FALSE to 1 and 0?
Multiply by 1, use the double minus (--), or wrap the cell in the N function. All three produce numeric 1 and 0.
Is the text "TRUE" the same as TRUE?
No. Text "TRUE" is a string and does not equal the logical TRUE. Clean the data or test it with UPPER(TRIM(cell))="TRUE".
Why does COUNTIF with TRUE not count my values?
The criteria TRUE matches logical values only. If your cells hold 1 and 0, use COUNTIF(range,1) instead.