Power Query: Replace All Text and Number With Null (Bulk Replace)

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all
i have problem how to replace column (bulk replace) using formula
i have 2 situation:
1. replace any text with null
2. replace any number with null
3. replace combine text and number with null
here my layout table
tranpose complex.xlsx
AB
1case1
2RegionRegion
3KPKNL testingnull
4samplenull
5textnull
6jjhnnull
7mikanull
8sissanull
Sheet2

and

tranpose complex.xlsx
AB
10case2
11RegionRegion
1245null
1323null
141,2null
150,23null
161000null
17240null
Sheet2


anyone help, thanks in advance

susant
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Power Query:
#"Added Custom" = Table.AddColumn(#"Trimmed Text", "Region", each null)
 
Upvote 0
Solution
just gave you the line of code that you would add once you loaded your table to PQ. Again, suggest you get the book, so you don't have to be spoon fed for every line and really understand how PQ works.
 
Upvote 0
All three result in a null, so you don't need to distinguish. What other possibility could you have, text, numbers, text and numbers all result in null so you don't need an if then situation.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,692
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top