Excel Yes or No Formula: How to Return Either Answer

Formulas & functions · Updated November 18, 2026

Yes. To show “Yes” when a test is true and “No” when it is false, put the value to check in A2 and use =IF(A2>=10,"Yes","No"); if A2 contains 12, the result is Yes. Replace the test with your own condition, then fill the formula down for other rows.

How the Excel yes-or-no formula works

Excel’s IF function checks a condition and returns one value when that condition is true and another when it is false. Its general structure is =IF(condition,value_if_true,value_if_false). The condition might compare a number, check whether text matches, or test whether another formula produces a particular result.

For the opening example, the assumed layout is a number in A2 and a threshold of 10. The formula =IF(A2>=10,"Yes","No") returns Yes for 10 or any larger number, and No for a smaller number. The quotation marks make Yes and No text values. You can change the words, for example to “Pass” and “Fail,” while keeping the same structure.

The comparison operator determines what counts as true:

  • > means greater than; >= means greater than or equal to.
  • < means less than; <= means less than or equal to.
  • = means equal to; <> means not equal to.

Excel calculates the condition first, then IF displays the corresponding result. The formula does not change the value in A2; it creates an answer in the cell where you enter the formula. That distinction is useful when you want a readable status column alongside the original data.

Choose a condition that matches your question

Before writing the formula, describe the rule in ordinary language: “show Yes if the quantity is at least 10.” Then identify the cell containing the quantity, the comparison operator, and the threshold. This prevents common mistakes such as using greater than when the boundary value should also qualify.

With order quantities in B2 and a minimum of 10, enter =IF(B2>=10,"Yes","No"). If B2 contains 10, the answer is Yes because the condition includes equality. If you instead use =IF(B2>10,"Yes","No") with the same layout, a quantity of exactly 10 returns No. Decide which boundary is intended before copying a formula across hundreds of records.

For a date test, Excel stores dates as serial numbers and can compare them with another date. With a due date in C2 and the cutoff date in E1, use =IF(C2<=$E$1,"Yes","No"). If C2 is on or before the date in E1, the result is Yes; a later date returns No. The dollar signs keep the cutoff reference fixed when the formula is filled down. Enter E1 as a real Excel date, not text that merely looks like a date.

Useful questions to ask when setting up a rule include:

  • Should the exact threshold count as Yes?
  • Are the compared values numbers, dates, or text?
  • What should happen if the source cell is empty?
  • Does the formula need one test or several?

Check whether text matches

For a text match, use an equality test inside IF. With a status in A2, the formula =IF(A2="Paid","Yes","No") returns Yes when A2 contains Paid and No otherwise. Text values inside a formula need straight quotation marks. Excel’s ordinary equality comparison is not case-sensitive, so “paid” also matches “Paid.”

To check whether a cell contains a word as part of a longer phrase, rather than matching the whole cell, use SEARCH with ISNUMBER. With notes in A2, use =IF(ISNUMBER(SEARCH("approved",A2)),"Yes","No"). If A2 says “Approved by manager,” the result is Yes because SEARCH finds the word and returns its position; if it is absent, SEARCH returns an error and ISNUMBER evaluates to false. SEARCH does not distinguish uppercase from lowercase. Use this approach when entries include extra words, but remember that a partial match can also find the word inside a longer string.

If your data comes from imports or manual entry, apparent matches can fail because of extra spaces or inconsistent spelling. Check the source text and, when appropriate, clean it before relying on an exact comparison. A formula that treats “Paid ” with a trailing space differently from “Paid” may be exposing a data-quality problem rather than an IF problem.

Test more than one condition

Some decisions require all conditions to be true, while others require only one. AND and OR let you combine tests inside IF. With a score in B2 and an attendance percentage in C2, use =IF(AND(B2>=70,C2>=0.8),"Yes","No") to return Yes only when the score is at least 70 and attendance is at least 80%. A score of 75 with attendance of 0.8 returns Yes; if either value falls below its threshold, the result is No.

Use OR when either condition is enough. With a customer type in A2 and an order total in B2, =IF(OR(A2="Priority",B2>=500),"Yes","No") returns Yes if the customer is Priority or the order total is at least 500. It also returns Yes when both are true. AND and OR are appropriate for straightforward tests; when rules become complicated, break them into helper columns so the logic is easier to inspect and explain.

For more than two outcomes, you can place another IF inside an IF. With a score in A2, =IF(A2>=80,"Yes",IF(A2>=50,"Review","No")) returns Yes for a score of 80 or higher, Review for a score from 50 through 79, and No below 50. The order matters: Excel checks the first condition before moving to the next. For many categories, a lookup table may be clearer than a long chain of nested IF functions.

Handle blanks deliberately

A blank input can produce a surprising answer. In some comparisons, Excel treats a genuinely empty cell like zero, so a basic threshold test may label an unfinished row No. If you want the result to stay blank until a value is entered, add a blank check first. With the number to test in A2, use =IF(A2="","",IF(A2>=10,"Yes","No")). An empty A2 produces an empty-looking result; a value of 10 produces Yes.

There is a difference between an empty-looking cell and a cell containing a formula that returns an empty string. The test above treats both as blank for this purpose. If zero is a valid value in your data, do not use a test that assumes zero means “missing”; use a true blank check or a separate field that records whether the data was entered.

For data that may contain errors, decide whether an error should be fixed, displayed, or converted into a status. IFERROR can replace an error with a chosen result, but using it indiscriminately can hide an underlying problem. With a calculation in A2 that may return an error, =IFERROR(IF(A2>=10,"Yes","No"),"Check data") displays Check data when the calculation errors. If the source value is expected to be valid, investigating the error is often better than masking it.

Fill the formula down a column

Enter the formula in the first result row, then copy it to the other rows. If names are in A2:A20 and quantities are in B2:B20, put =IF(B2>=10,"Yes","No") in C2. The first result is based on B2; after filling down, the next row should refer to B3, then B4, and so on. Excel adjusts these relative references automatically.

On Windows, select the formula cell and use Ctrl+D to fill down into selected cells, or drag the fill handle at the cell’s lower-right corner. You can also copy the formula cell and paste it into the destination range. On Mac, the ribbon command Home > Fill > Down is available; keyboard shortcuts can vary with keyboard and system settings. Excel for the web supports formula entry and the fill handle, though the interface may differ slightly from the desktop application.

Use dollar signs when a reference should remain fixed while another reference moves. For example, if the threshold is stored in E1, and quantities begin in B2, enter =IF(B2>=$E$1,"Yes","No") in C2 and fill down. B2 changes by row, but E1 remains fixed. In Excel, F4 cycles through reference styles while editing a reference on Windows; Mac keyboards or settings may require a different key combination, so typing the dollar signs directly is a reliable alternative.

Text answers versus TRUE and FALSE

“Yes” and “No” are text labels. They are convenient for reports, filters, and readers who need a plain-language status. However, if another formula will use the result in calculations or logical tests, returning Excel’s logical values TRUE and FALSE may be more useful.

With a number in A2 and a threshold of 10, enter =A2>=10 to return TRUE when the condition is met and FALSE when it is not. For A2 equal to 12, the result is TRUE. This is a logical value, not the text “TRUE.” You can later use it in another formula, or change how it appears using cell formatting. Choose text labels when people need to read the result, and logical values when the result is part of further calculations.

Another common misconception is that IF is required for every yes-or-no answer. It is not: a comparison by itself already returns TRUE or FALSE. IF is useful when you want different displayed words, want to handle blanks specially, or need different outcomes such as Pass, Review, and Fail.

Common problems and quick checks

If a formula appears in the cell instead of its answer, check that the cell is not formatted as Text. Change it to General, then edit and re-enter the formula. Also check whether Show Formulas is enabled; on Windows, Ctrl+` toggles formula display. The key may be in a different position on some keyboards, and Mac shortcuts can differ, so the Formulas ribbon’s Show Formulas command is another way to check.

If Excel rejects a formula, inspect the quotation marks and parentheses, and confirm that the comparison refers to the intended cells. Some regional settings use semicolons rather than commas as function argument separators. The examples here use commas, as specified for the usual Microsoft 365 setup in this article; if Excel expects semicolons on your computer, substitute the separator your installation uses.

If the result is wrong even though the formula is accepted, check the underlying data type. A number stored as text, a date stored as text, leading or trailing spaces, or a reference that shifted during copying can all affect the comparison. Click the source cell, inspect the formula bar, and verify a few rows manually, including values exactly on the threshold. A small sample check often reveals whether the rule or the data needs correction.

Frequently Asked Questions

How do I make Excel say yes or no based on a number?
Put the number in a cell, choose a threshold and comparison operator, then wrap that test in IF. For example, if A2 contains the number and 10 is the cutoff, the opening example returns Yes for 10 or more and No for less.

Can Excel return Yes when a cell contains a word?
Yes. Use an exact text comparison if the whole cell should match, or SEARCH when the word may appear inside a longer note. Keep in mind that a partial search can match text you did not intend, and SEARCH ignores letter case.

How can I leave the answer blank when the input is empty?
Test for an empty input before testing the main condition. The blank-handling example above returns an empty-looking result for an empty A2 and only displays Yes or No once there is a value to evaluate.

Can a formula return actual TRUE or FALSE instead of words?
Yes. Enter the comparison by itself, such as the logical comparison shown above. It returns Excel’s TRUE or FALSE values, which can be more useful when another formula will use the result.

Why does Excel show the formula instead of Yes or No?
Check whether the cell is formatted as Text, whether the formula begins with an apostrophe, or whether Show Formulas is turned on. Set the cell to General and re-enter the formula if needed.

Does the formula work in Excel for Mac or Excel for the web?
IF, AND, OR, and the comparisons used here are available in current Excel for Windows, Mac, and the web. The main differences are interface details, keyboard shortcuts, and regional argument separators—not the basic logic of the formula.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.