How to Display Text Based on Positive or Negative Values in Excel
Question details
The user needs an Excel formula to display specific text in a cell depending on whether the numeric value in another cell is positive, negative, or zero.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Categorizing numeric data with specific text labels based on its sign (positive vs. negative) using logical functions.
- Observed behavior
- Requires a formula that outputs one text string for negative numbers and another text string for positive numbers or zero.
Ensure you have identified the target cell containing the numeric value you want to evaluate and the empty destination cell where the text label should appear.
Use a Standard IF Formula
Use this straightforward IF function to evaluate a single condition, outputting one text string for negative numbers and another for positive numbers or zero.
The IF function tests a condition and returns one value if true, and another if false. In this scenario, we check if the value is less than zero.
Click on the cell where you want the text label to appear (for example, AJ7).
Type the formula =IF(AJ6<0,"L","OT") into the formula bar, replacing AJ6 with the cell containing your number.
Press Enter to execute the formula. The cell will now display "L" if the number is negative, and "OT" if it is zero or positive.

Use a Nested IF Formula for Three Distinct Conditions
If you need to display completely different text for positive, negative, and exactly zero, a nested IF formula is required to handle all three states.
Easily Apply Logical Formulas with WPS Spreadsheet
WPS Office provides full support for standard spreadsheet functions like the IF formula, allowing you to categorize data seamlessly and efficiently.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your data.
- 2. Start the formula: Click on your destination cell and type =IF( to trigger the formula tooltips.
- 3. Define the logic: Select the reference cell, type your condition (e.g., <0), add a comma, and specify the true and false text outputs enclosed in quotes.
- 4. Complete and fill: Press Enter to complete the formula, then double-click the cell's fill handle to apply it down the entire column.

Frequently Asked Questions
Why is my IF formula returning an error or a #NAME? message?
Errors often occur if text values are not enclosed in double quotation marks (e.g., "Text"). Excel treats text without quotes as a function name. Ensure all commas, quotation marks, and parentheses are correctly placed.
Can I format the text color based on the value instead of just displaying text?
Yes, you can use Conditional Formatting. Go to Home > Conditional Formatting > Highlight Cells Rules, and set specific font or fill colors for values that are 'Greater Than' or 'Less Than' zero.
Does this formula update automatically if the original number changes?
Yes. As long as your workbook's calculation options are set to automatic (which is the default), the formula will instantly update the displayed text whenever the referenced cell value changes.




