How to Apply an Accounting Underline with Conditional Formatting in Excel
Question details
The user wants to apply an accounting underline to numeric cells using conditional formatting, but encounters visual issues such as partial underlines on zero values (displayed as dashes) and formatting conflicts on text cells.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Applying conditional formatting with accounting underlines to financial or numeric data ranges.
- Observed behavior
- Standard underlines are applied, but zero values displayed as dashes show partial underlines, and text cells included in the range lose their custom formatting.
Ensure your numeric cells are already formatted using the Accounting number format, and identify any cells containing zero values or text within your target range.
Apply Conditional Formatting and Exclude Zero Values
Use a custom conditional formatting rule to apply the single underline only to non-zero numeric values, avoiding the partial underline issue on zero-value dashes.
Because the Accounting format aligns decimal places, the underline appears to stop at the displayed zero or dash, treating the empty decimal portion differently. By excluding zeroes from the conditional rule, you prevent this incomplete underline.
Highlight the numeric cells where you want to apply the accounting underline.
Right-click the selected cells, choose 'Format Cells', go to the 'Number' tab, and apply the 'Accounting' format (currency symbol is optional).
Navigate to the Home tab, click 'Conditional Formatting', select 'New Rule', and choose 'Format only cells that contain'.
Set the rule criteria to 'Cell Value', 'greater than', and enter '0'. If your data contains negative numbers, create a second identical rule using 'less than' '0'.
Click the 'Format' button, navigate to the 'Font' tab, select the 'Single' underline option from the dropdown menu, and click 'OK' to apply the rule.

Exclude Text Cells from the Formatting Range
Prevent conditional formatting rules from overriding the manual formatting of text cells, such as column headers or labels.
Format Financial Data Flawlessly with WPS Spreadsheet
WPS Office provides robust Spreadsheet tools that seamlessly support conditional formatting and complex accounting number formats, making financial data management effortless and visually accurate.
- 1. Open your workbook: Launch WPS Spreadsheet and open your existing financial file.
- 2. Select your data range: Highlight the numeric cells requiring the accounting underline.
- 3. Apply Accounting format: Right-click the selection, choose 'Format Cells', and select the 'Accounting' category under the Number tab.
- 4. Set Conditional Formatting: Click 'Conditional Formatting' on the Home tab, set your criteria to format values greater or less than zero, and apply the single underline style.

Frequently Asked Questions
Why does the underline on a zero value look cut off or partial?
When using the Accounting format, zero values are often displayed as a dash. The underline stops at the displayed dash because the software aligns the decimal places, leaving the empty decimal portion un-underlined. Excluding zeroes from the conditional formatting rule prevents this visual glitch.
Can I apply an accounting underline to text cells using conditional formatting?
If a text cell is included in the conditional-formatting range, the conditional formatting often overrides its native underline formatting. It is recommended to exclude text cells from your conditional formatting range and apply the accounting underline to them manually for consistent results.
Does the Accounting number format require a currency symbol?
No, you can use the Accounting format with or without a currency symbol. The formatting will still accurately align your decimal points and display zeroes as dashes even if the symbol setting is changed to 'None'.




