# How to show a message with a number in an IF formula in Excel

Join text and the calculation with &: =IF(B2<C2,"Order "&C2-B2&" more","Stock OK").

**Excel:** `=IF(B2<C2,"Order "&C2-B2&" more","Stock OK")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Item | On hand | Reorder at | Message |
| Copy paper | 120 | 200 |  |
| Toner | 14 | 10 |  |
| Staples | 35 | 50 |  |
| Pens | 300 | 250 |  |
| Folders | 48 | 60 |  |
| Labels | 75 | 75 |  |

Formula in D2, filled to D7: `=IF(B2<C2,"Order "&C2-B2&" more","Stock OK")`

Result: Order 80 more; Stock OK; Order 15 more; Stock OK; Order 12 more; Stock OK

## How it works

& joins pieces into one piece of text. Subtraction is worked out before joining, so `"Order "&C2-B2&" more"` becomes "Order 80 more" without extra parentheses. The spaces inside the quotes keep the words apart.

## Other ways

- `=IF(B2<C2,"Order "&TEXT(C2-B2,"#,##0")&" more","Stock OK")`: TEXT controls how the number looks inside the message, such as thousands separators or decimals.
- `=IF(B2<C2,CONCAT("Order ",C2-B2," more"),"Stock OK")`: CONCAT joins its arguments, the same as &.

## Common mistakes

- A calculated number keeps all its decimals inside text: 12.3456 shows in full. Wrap it in TEXT or ROUND.
- Missing spaces run words together: `"Order"&15` gives "Order15".
- The result is text, so the column can't be totaled. Keep the number in its own column if you need it.

## Questions

**How do I put a currency amount in the message?**

Format it with TEXT: `"Short by "&TEXT(C2-B2,"$#,##0.00")`.

**How do I add a line break inside the message?**

Join CHAR(10) and turn on Wrap Text: `="Order"&CHAR(10)&C2-B2&" more"`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/if-message-with-a-number
