Formatting Issues

Can Excel Custom Number Formats Perform Arithmetic?

Adam DavisAdam Davis Oct 26, 2026 868 views

Question details

The user wants to know if Excel custom number formatting can be used to perform arithmetic, specifically to display a single cell value as a calculated range.

Can Excel Number Formats Perform Arithmetic?
Product
Excel
Device & OS
not provided
Scenario
Attempting to create a custom number format code that mathematically alters a cell's display, such as taking a value of 5 and displaying it as the range '4-5'.
Observed behavior
Custom number formats only modify the visual representation of the existing cell value; they cannot process mathematical operations or calculate dynamic ranges based on the original number.
Before you start

Keep in mind that when using formulas to output a range with a hyphen (like '4-5'), Excel treats the result as text, meaning you cannot easily use that cell in standard numeric calculations without additional parsing.

Solution 1Recommended

Use an Ampersand (&) Formula to Calculate and Display a Range

Since number formatting cannot perform arithmetic, you must use a formula to stitch your mathematical calculations together into a text string representing the range.

This approach uses Excel's concatenation operator (&) to combine the results of two separate calculations alongside a text character (the hyphen) into a single cell.

1
Select the target cell

Click on the empty cell where you want the calculated range to be displayed.

2
Enter the concatenation formula

Type the formula combining your math and a hyphen, such as =A3-1&"-"&A3 (assuming your base value is in cell A3).

3
Apply the calculation

Press Enter to see the result displayed as a range. If cell A3 contains 5, the formula will display '4-5'.

Use an Ampersand (&) Formula to Calculate and Display a Range
Formatting Text Results: Even though the output is text, you can right-align the cell to make it visually match standard numeric data in your spreadsheet.
Manage Data Seamlessly

Calculate and Format Data Easily with WPS Spreadsheet

WPS Spreadsheet offers robust formula capabilities and high compatibility with Microsoft Excel, allowing you to easily construct complex text strings, parse data, and apply custom number formats for free.

  1. 1. Open your document: Launch WPS Spreadsheet and open your workbook.
  2. 2. Input the calculation formula: Select a cell and enter your formula, such as =A1-1 & "-" & A1.
  3. 3. View the result instantly: Press Enter to instantly display your calculated range as a text string.
Fully compatible with Microsoft Excel formulas and custom number formats.Lightweight application with incredibly fast calculation speeds.Intuitive user interface for building and troubleshooting complex nested formulas.
microsoft office alternative - wps office

Frequently Asked Questions

Can conditional formatting perform arithmetic in Excel?

Conditional formatting can evaluate mathematical calculations to determine if a formatting rule should be applied, but it cannot change the actual cell value or output a newly calculated number.

How do I apply a custom number format without changing the cell value?

Select your cell, press Ctrl+1 to open the Format Cells dialog, navigate to the Custom category, and enter your format code (e.g., '0.00'). The underlying value remains unchanged for calculations.

Can I use custom formatting to add text strings to a number?

Yes. In the Custom Number Format dialog, you can append text by enclosing it in quotation marks. For example, formatting a cell with 0 "Units" will display '5 Units' while keeping the underlying value as the number 5 for future arithmetic.