Power Query Problems

How to Fix Power Query Cannot Convert Values to Numbers in Excel

Khadija KhanKhadija Khan Nov 3, 2026 869 views

Question details

Users encounter errors when attempting to convert a column of seemingly numeric data into a Number data type in Power Query.

How to Fix Power Query Cannot Convert Values to Numbers in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Changing the data type of a column to Number or Whole Number in the Power Query Editor.
Observed behavior
Certain rows fail to convert and return an 'Error' value instead of numbers, typically caused by hidden formatting or non-printing characters.
Before you start

Ensure you click 'Keep Errors' temporarily to isolate the exact rows causing the issue before applying bulk transformations.

Solution 1Recommended

Apply Trim and Clean Transformations

Remove invisible non-printing characters and leading or trailing spaces that prevent numbers from being recognized by Power Query.

Often, data imported from web pages or external databases contains hidden line breaks, leading spaces, or trailing spaces. Power Query cannot parse these as numbers until the text is sanitized.

1
Select the problematic column

Click on the header of the column containing the values that failed to convert in the Power Query Editor.

2
Apply the Trim function

Navigate to the 'Transform' tab on the top ribbon, click on 'Format', and select 'Trim' from the dropdown to remove normal leading and trailing spaces.

3
Apply the Clean function

Go back to the 'Format' menu under the 'Transform' tab and select 'Clean' to strip out any non-printing or control characters from the dataset.

4
Convert the data type

Click the data type icon (usually reading 'ABC' or 'Any') next to the column header and select 'Whole Number' or 'Decimal Number'.

Apply Trim and Clean Transformations
Data Type Validation: Once cleaned, the column should convert seamlessly without yielding 'Error' values.
Free Microsoft Office alternative

Process Data Smoothly with WPS Spreadsheet

If you frequently struggle with complex data import errors in Microsoft Excel's Power Query, try WPS Office. It provides a lightweight, highly compatible, and user-friendly spreadsheet environment equipped with intuitive data cleaning tools.

  1. 1. Download and install: Get WPS Office for free from the official website and run the quick installer.
  2. 2. Open your dataset: Launch WPS Spreadsheet and open your existing Excel or CSV file directly.
  3. 3. Clean your data: Use the built-in 'Data' tab tools or functions like =TRIM() and =CLEAN() to easily sanitize your numbers without complex query editors.
100% format compatibility with Microsoft Excel files (.xlsx, .csv, .xls).Built-in, intuitive data cleaning tools like Text to Columns and Remove Duplicates.Completely free and lightweight, ensuring smooth performance on any device.Familiar user interface requiring no learning curve for seamless migration.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query show an error when converting text to numbers?

This typically happens because the text contains characters that are not recognizable digits, such as letters, currency symbols, leading/trailing spaces, or hidden non-printing characters like line breaks.

What does the Clean function in Power Query actually do?

The Clean function removes non-printing control characters from your text. These are often hidden characters exported from databases or web applications that interfere with data type conversions.

How do I remove non-breaking spaces (character code 160) in Power Query?

The standard Trim function does not always remove non-breaking spaces. To remove them, use the 'Replace Values' feature in the Transform tab. Enter '#(00A0)' (the hex code for a non-breaking space) in 'Value To Find', leave 'Replace With' blank, and apply.

Can I simply ignore or remove the errors when changing data types?

Yes, you can right-click the column header and select 'Remove Errors', or go to Home > Remove Rows > Remove Errors. However, this deletes the entire row from your dataset, which can lead to data loss. Cleaning the data is generally preferred over removing errors.