Substitute Alphanumeric Values

martinmc

New Member
Joined
Apr 21, 2019
Messages
16
Hi, Is there any other alternative or shorter solution for rewriting the below formula example.i have read in an older post that the SUBSTITUTE function cannot handle the "old_text" part as an array{1,2,3,4,5,6,7,8,9,0}
Thanks In Advance.

[TABLE="class: grid, width: 800"]
<tbody>[TR]
[TD]A1B2C3D4E5F6G7H8J9K0
[/TD]
[TD]=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( SUBSTITUTE( SUBSTITUTE(SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE(A1,0,""),1,""), 2,""),3,""),4,""), 5,""),6,""),7,""),8,""),9,"")
[/TD]
[/TR]
[TR]
[TD]Result In B1[/TD]
[TD][TABLE="width: 94"]
<tbody>[TR]
[TD="width: 94"]ABCDEFGHJK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
And here is a non-looping one-liner UDF...
Code:
[table="width: 500"]
[tr]
	[td]Function TextOnly(ByVal S As String) As Variant
  TextOnly = Replace(Join(Evaluate("TRANSPOSE(IF(ISNUMBER(-MID(A1,ROW(1:" & Len(S) & "),1)),"""",MID(A1,ROW(1:" & Len(S) & "),1)))")), " ", "")
End Function[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thank You Sandy666, PowerQuery is all new to me at the moment and i will definitely give this a try out. :)
 
Upvote 0
i am currently using Microsoft Office Home and Business 2013, Office 365 will be my next investment very soon.:)

Excel 2013 doesn't contain PowerQuery. Especially Excel H&B, so you really need higher version.
 
Upvote 0
Thanks all again for your time and replies, i am very new to this forum and i have heard a while back that there are very clever Excel people on this site and i have to say they are 100% correct so far.:)
 
Upvote 0

Forum statistics

Threads
1,223,697
Messages
6,173,895
Members
452,536
Latest member
Chiz511

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