Function that can remove any characters before a first number in a string

tongcy

New Member
Joined
Nov 9, 2013
Messages
33
How to write a function that can remove any characters before a first number in a string ? For instances,

Serial1/1 will become 1/1
GIGE0/1/7:1 will become 0/1/7:1
Fast1/7/LT will become 1/7/LT
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
How to write a function that can remove any characters before a first number in a string ? For instances,

Serial1/1 will become 1/1
GIGE0/1/7:1 will become 0/1/7:1
Fast1/7/LT will become 1/7/LT
Give this formula a try...

=MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),99)
 
Upvote 0
How to write a function that can remove any characters before a first number in a string ? For instances,

Serial1/1 will become 1/1
GIGE0/1/7:1 will become 0/1/7:1
Fast1/7/LT will become 1/7/LT

B2, copied down:

=REPLACE($A2,1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},$A2&"0123456789"))-1,"")
 
Upvote 0
B2, copied down:

=REPLACE($A2,1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},$A2&"0123456789"))-1,"")

How to enhance this function to exclude remove any characters before a first number in a string and any characters after . or : ? for instance:

GigabitEthernet0/3.210 --> 0/3
Serial6/2:0.100 --> 6/2
Serial6/6:0 --> 6/6
 
Upvote 0
How to enhance this function to exclude remove any characters before a first number in a string and any characters after . or : ? for instance:

GigabitEthernet0/3.210 --> 0/3
Serial6/2:0.100 --> 6/2
Serial6/6:0 --> 6/6

Try...

B2, copied down:
Rich (BB code):
=REPLACE(LEFT(A2,MIN(FIND({".",":"},A2&".:"))-1),1,
  MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"))-1,"")
 
Upvote 0

Forum statistics

Threads
1,215,050
Messages
6,122,868
Members
449,097
Latest member
dbomb1414

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