Formatting Issues

How to Apply an Accounting Underline with Conditional Formatting in Excel

Aamir Naveed AkramAamir Naveed Akram Oct 29, 2026 868 views

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.

How to Apply an Accounting Underline with Conditional Formatting in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the data range

Highlight the numeric cells where you want to apply the accounting underline.

2
Set the Accounting format

Right-click the selected cells, choose 'Format Cells', go to the 'Number' tab, and apply the 'Accounting' format (currency symbol is optional).

3
Create a new formatting rule

Navigate to the Home tab, click 'Conditional Formatting', select 'New Rule', and choose 'Format only cells that contain'.

4
Exclude zero values

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'.

5
Apply the underline style

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.

Apply Conditional Formatting and Exclude Zero Values
Handling Zero Values Manually: Since zeroes are intentionally excluded from the conditional formatting rule, you can manually format those specific zero-value cells if an underline is still strictly required.
Manage Spreadsheets with Ease

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. 1. Open your workbook: Launch WPS Spreadsheet and open your existing financial file.
  2. 2. Select your data range: Highlight the numeric cells requiring the accounting underline.
  3. 3. Apply Accounting format: Right-click the selection, choose 'Format Cells', and select the 'Accounting' category under the Number tab.
  4. 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.
Fully compatible with Microsoft Excel (.xlsx) formats and conditional formatting rules.Intuitive interface for applying Accounting number formats and custom underlines.Lightweight and fast, ensuring smooth performance even when handling large financial datasets.Free to use with comprehensive data analysis and visualization tools.
microsoft office alternative - wps office

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'.