Mixed Column of Text & Numbers - want to replace text with 'null', but keep numbers

jase71ds

Board Regular
Joined
Oct 23, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
I have a mixed alpha/num column.
I want to keep all numbers (which Power Query correctly identifies and places to the right of the cell).
All of the text (again, correctly identified as text, and therefore left justified) I want to replace with 'null'

NOTE. The text is extremely varied, so I can't just do a find and replace.

Any help is appreciated.
Thanks.
Jase.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Thanks.
I figured out a hack-work-around. I have another column that has a number 1 in those same rows where text occurs, so I'm just filtering out the other columns one's. Probably a horrible hack, but it is working.
 
Upvote 0
you could use =ISTEXT() or =ISNUMBER()
 
Upvote 0
Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"raw", type number}}),
    #"Replaced Errors" = Table.ReplaceErrorValues(#"Changed Type", {{"raw", null}})
in
    #"Replaced Errors"[/SIZE]

with formula:

=IFERROR(A1*1,"null")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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