Formatting Issues

How to Display Negative Numbers for Sell Transactions in Excel

Muhammad TalhaMuhammad Talha Nov 11, 2026 869 views

Question details

The user needs to display quantities with a minus sign when the transaction type is marked as 'SELL', either by changing the visual appearance or by converting the actual values for further calculations.

How to Display Negative Numbers for Sell Transactions in Excel
Product
Excel
Device & OS
not provided
Scenario
Formatting and processing buy/sell transaction data to clearly identify and calculate net quantities.
Observed behavior
Quantities for 'SELL' transactions are currently displayed as positive or unsigned numbers, which can lead to confusion or errors when calculating the net balance.
Before you start

Determine whether you only want to visually change the number to show a minus sign (for reporting) or if you need to convert the actual underlying value to a negative number to be used in sum formulas.

Solution 1Recommended

Use Conditional Formatting to Display a Minus Sign

This method changes only the visual appearance of the numbers. It adds a minus sign to the cell display without altering the actual positive numeric value.

Conditional formatting allows you to dynamically apply custom number formats based on the value of another cell, such as a transaction type column.

1
Select the target cells

Highlight the range of cells in your quantity column (e.g., column B) that you want to format.

2
Create a new formatting rule

Navigate to the Home tab on the ribbon, click on 'Conditional Formatting', and select 'New Rule'.

3
Enter the condition formula

Choose the option 'Use a formula to determine which cells to format' and enter the formula: =$A2="SELL" (assuming column A contains the transaction type).

4
Apply the custom format

Click the 'Format' button, go to the 'Number' tab, select 'Custom', and type "-"0 in the Type box. Click OK to apply the rule.

Use Conditional Formatting to Display a Minus Sign
Appearance vs. Actual Value: Remember that this solution only changes how the data looks. Any SUM formulas using these cells will still treat them as positive numbers.
Efficient Data Formatting

Manage Transaction Data Easily in WPS Spreadsheet

WPS Spreadsheet offers powerful conditional formatting tools and comprehensive formula support to effortlessly handle transaction records, completely free of charge.

  1. 1. Open your data: Launch WPS Spreadsheet and open your transaction records file.
  2. 2. Highlight the quantity column: Select the cells containing the numbers you wish to format.
  3. 3. Access Conditional Formatting: Go to the 'Home' tab, click 'Conditional Formatting', and choose 'New Rule'.
  4. 4. Set the rule: Use the formula option to check for the 'SELL' criteria and apply the custom '-"0' number format.
Fully compatible with Microsoft Excel (.xlsx) formulas and formattingFree, lightweight, and fast to launch on any operating systemIntuitive UI makes conditional formatting simple for beginners
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the conditional formatting change the actual value in the cell?

Conditional formatting is designed to alter only the visual presentation (like color, font, or number format) of a cell based on certain criteria. The underlying data remains completely unchanged to prevent accidental data loss or calculation errors.

How can I calculate the net total if the cells only visually show a minus sign?

If you used conditional formatting to display the minus sign, you cannot simply use a standard SUM function. Instead, use a SUMIF formula to subtract the sell quantities, such as: =SUMIF(A:A,"BUY",B:B) - SUMIF(A:A,"SELL",B:B).

Can I also change the font color of the sell numbers to red?

Yes. While setting up your Conditional Formatting rule, after entering the custom number format "-"0, you can switch to the 'Font' tab in the same formatting dialog box and select red from the color dropdown. This will apply both the minus sign and the red text simultaneously.