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

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,091
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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
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,223,996
Messages
6,175,851
Members
452,675
Latest member
duongtruc1610

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