Function Problems

How to Display Text Based on Positive or Negative Values in Excel

Kushani NimanthikaKushani Nimanthika Oct 29, 2026 868 views

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.

How to Display Text Based on Positive or Negative Values in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select destination cell

Click on the cell where you want the text label to appear (for example, AJ7).

2
Enter the IF formula

Type the formula =IF(AJ6<0,"L","OT") into the formula bar, replacing AJ6 with the cell containing your number.

3
Apply the formula

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 Standard IF Formula
Customizing the text: You can replace 'L' and 'OT' in the formula with any text you prefer, making sure to keep the double quotation marks around the text.
Efficient Formula Calculation

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. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your data.
  2. 2. Start the formula: Click on your destination cell and type =IF( to trigger the formula tooltips.
  3. 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. 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.
100% compatible with Microsoft Excel formulas, functions, and file formats.Intuitive formula prompts and auto-completion to reduce typing errors.Free, lightweight, and user-friendly alternative for advanced data management.Built-in error checking to help troubleshoot nested IF conditions.
microsoft office alternative - wps office

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.