0Pricing
Excel Formulas Academy · Lesson

Returning Text or Numbers From IF

Show custom messages or calculated values based on a condition.

Returning Text or Numbers From IF is a free Excel Formulas Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Excel Formulas Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

IF Can Return Anything

You have built solid tests. Now let's focus on the two outcomes IF returns.

An IF result can be a piece of text, a number, a blank cell, or even another calculation. Choosing the right kind of output makes your sheet clear and useful.

Returning Text Messages

To show words, wrap each outcome in double quotes. The quotes tell the spreadsheet "treat this as literal text".

For a payment status in A2:

Without the quotes the spreadsheet would think "Paid" is a name or formula and likely show an error.

=IF(A2 = "Y", "Paid", "Unpaid")

Returning Numbers

Numbers are returned without quotes. Quoting a number would turn it into text that you cannot add up later.

Award 100 points for a win, 0 otherwise:

Because these are real numbers, you can SUM the result column for a grand total.

=IF(B2 = "Win", 100, 0)

Returning a Blank Cell

Sometimes the cleanest false result is nothing at all. Use a pair of empty quotes "" to leave the cell looking blank.

To show a warning only when stock runs low:

When stock is fine, the cell stays empty instead of cluttering your sheet with the word "OK".

=IF(C2 < 5, "Low stock", "")

Returning a Calculation

An outcome can be a formula, not just a fixed value. The spreadsheet runs that calculation only when its branch is chosen.

Give a 10% discount to large orders, full price otherwise. Price is in A2:

Here the TRUE branch multiplies the price by 0.9, while the FALSE branch leaves it unchanged.

=IF(A2 > 100, A2 * 0.9, A2)

Mixing References Into Text

You can build a message that includes a cell's value using the & joiner.

If a name sits in A2, greet only VIP customers:

The & glues the word "Welcome " to the name. Notice the space inside the quotes so the words do not run together.

=IF(B2 = "VIP", "Welcome " & A2, "")

Worked Example: Commission

Salespeople earn 5% commission on sales above 1000, and nothing below that. Sales are in column A.

For row 2:

The TRUE branch computes the commission as a real number, so you can total the column and pay out the result.

=IF(A2 > 1000, A2 * 0.05, 0)

Text Versus Number Matters Later

Choosing text or number outcomes affects what you can do next.

  • Text results like "Pass" are great for reading but cannot be summed
  • Number results like 100 can be added, averaged, and charted

If you plan to do math on the column afterwards, return numbers. If it is just a label for people to read, text is fine.

Combining Both in One Sheet

It is common to have one IF column for a readable label and another for a number you can total.

Column C might show =IF(A2 >= 60, "Pass", "Fail") for humans, while column D shows =IF(A2 >= 60, 1, 0) so you can SUM how many people passed.

Same test, two different outcome types, each serving a purpose.

=IF(A2 >= 60, 1, 0)

Keeping Outcomes Consistent

A tidy habit is to make both outcomes the same kind of thing.

If the TRUE branch returns text, let the FALSE branch return text too. Mixing a number on one side and text on the other can confuse later calculations and sorting.

Consistency keeps your columns predictable and easy to work with.

Same in Excel and Sheets

Returning text, numbers, blanks, calculations, and joined strings all works identically in Microsoft Excel and Google Sheets.

The double-quote rule for text and the bare-number rule are universal across both tools.

Quick Check

Decide which outcome type fits the goal.

Recap: What IF Returns

You learned how to shape IF's output:

  • Text outcomes need double quotes; numbers do not
  • Use "" to leave a cell blank
  • An outcome can be a live calculation like A2 * 0.9
  • Use & to build messages that include cell values
  • Return numbers if you will do math later; text for plain labels

Next you will spot and fix the most common IF mistakes.

=IF(A2 > 100, A2 * 0.9, A2)

Frequently asked questions

Is the “Returning Text or Numbers From IF” lesson free?

Yes — the full text of “Returning Text or Numbers From IF” is free to read here on the web, and the Excel Formulas Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Excel Formulas Academy course, upgrade to CoddyKit PRO.

What will I learn in “Returning Text or Numbers From IF”?

Show custom messages or calculated values based on a condition. You practise Excel Formulas Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Excel Formulas Academy?

No prior experience is required. Excel Formulas Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Returning Text or Numbers From IF” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Excel Formulas Academy lesson?

Yes. Every Excel Formulas Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. How the IF Function Thinks
  2. Comparing Values With Operators
  3. Returning Text or Numbers From IF
  4. Common IF Mistakes to Avoid
← Back to Excel Formulas Academy