Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 More...Less
In Power Query, you can replace one value with another value in a selected column. You can replace specific values or the whole value in a cell. Replacing values in a query does not edit the external data source in any way.
The default behavior for text values is to search and replace a specific text string. This behavior canbe changed.
-
To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel.
-
Select a column with a text data type.
-
Select Home or Transform > Replace Value. TheReplace Values dialog box appears.
-
In the Value To Findbox, enter the value to search.
-
In theReplace Withbox, enter the value to replace.
-
Under Advanced options, do one or more of the following:
Match Bydefault, specific text values are replaced. To replace the the whole cell value, selectMatch entire cell contents.
(Video) Replace Values Based on Condition (in a Single Step) in Power QuerySpecial characters To handle special characters, select Insert special characters and then select one of the following from the drop-down list:Tab, Carriage Return, Line Feed,Carriage Return and Line Feed, and Non-breaking Space.
-
SelectOK.
The default behavior for non-text columns is to search and replace the full contents of a cell. This behavior can’t be changed.
-
To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel.
-
Select a column with a number, date/time,or logical data type.
-
Select Home or Transform > Replace Value. TheReplace Values dialog box appears.
-
In the Value To Findbox, enter the value to search.
-
In theReplace Withbox, enter the value to replace.
-
SelectOK.