How to Invert Number Signs in Excel Cells Containing Text and Numbers
Question details
The user needs to import data containing mixed text and numbers, separate the characters from the numbers, invert the mathematical signs of the numeric values, and export the final result.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Importing and cleaning text-file data containing combined text and numeric values.
- Observed behavior
- Data is imported as mixed strings. The goal state is to have the letters and numbers separated, with the numbers' signs inverted (positive to negative or vice versa) for third-party application export.
Ensure your original text file is saved locally and identify the consistent delimiter (e.g., an equals sign, comma, or space) used between your text and numeric values.
Use Power Query to Separate Text and Invert Numeric Signs
Power Query is the most efficient way to import, split, and transform mixed data columns in Excel.
Power Query allows you to automate the process of cleaning mixed-format data. By utilizing its splitting and mathematical transformation tools, you can easily separate strings from integers and flip the positive or negative status of the numbers.
Go to the Data tab on the Excel ribbon, click 'Get Data' (or 'From Text/CSV'), and select your source text file.
In the import window, choose the appropriate delimiter (such as an equals sign '=') to split the initial data, then click 'Transform Data' to open the Power Query Editor.
Use the 'Replace Values' feature under the Transform tab to remove any unwanted characters, such as braces or extra commas, by replacing them with a blank space.
Select the column with mixed data, click 'Split Column' in the Home tab, and choose to split by delimiter or by transitioning from non-digit to digit. Ensure the resulting numeric column is set to the 'Whole Number' or 'Decimal Number' data type.
Select the newly created numeric column, go to the Transform tab, click 'Standard' under the Number Column group, select 'Multiply', and enter '-1' to invert the signs.
Click 'Close & Load' to return the transformed data to your Excel spreadsheet. You can now go to File > Save As and save the document as a .txt or .csv file for your third-party application.

Use Excel Formulas and Paste Special to Invert Numbers
If you prefer not to use Power Query, you can utilize text extraction formulas and the Paste Special feature to achieve the same result directly in the worksheet.
Easily Separate Text and Invert Numbers in WPS Spreadsheet
WPS Spreadsheet offers powerful Data import wizards, Text-to-Columns capabilities, and Paste Special operations to help you clean and transform mixed data quickly.
- 1. Import the Text File: Open WPS Spreadsheet, navigate to the 'Data' tab, and click 'Import Data' to locate and open your source text file.
- 2. Split the Data: Highlight your imported data column, click 'Text to Columns' under the Data tab, and select the appropriate delimiter (like '=' or a space) to separate the text from the numbers.
- 3. Copy a Negative Multiplier: Type '-1' into an empty cell anywhere on the spreadsheet and copy that cell (Ctrl + C).
- 4. Invert the Signs: Highlight your newly separated numeric column, right-click, and choose 'Paste Special'. Under the Operation section, select 'Multiply' and click OK to instantly flip all the signs.
- 5. Export the File: Go to 'Menu' > 'Save As' and select a plain text format (.txt or .csv) to export your finalized data.

Frequently Asked Questions
Why did Power Query format my extracted numbers as text?
When splitting columns, Power Query might retain the original text format. You need to explicitly change the column data type to 'Whole Number' or 'Decimal Number' by clicking the ABC/123 icon in the column header before attempting to multiply by -1.
Can I invert number signs without using Power Query?
Yes. You can use the 'Text to Columns' tool in the Data tab to split your text and numbers into separate columns. Afterwards, type -1 in a blank cell, copy it, select your numbers, and use 'Paste Special' > 'Multiply' to flip the signs.
How do I remove unwanted braces from my data before splitting?
In the Power Query Editor, select the column containing the braces, go to the Transform tab, click 'Replace Values', enter the brace character (e.g., '{' or '}') in the 'Value To Find' box, leave the 'Replace With' box blank, and click OK.
What delimiter should I use when importing the text file?
You should select the specific character that naturally separates the text from the numbers in your dataset. Look at your raw data; common delimiters include commas, spaces, dashes, or equals signs.




