Extract Strings which hyphen in the code

rikkiw

New Member
Joined
Mar 11, 2024
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello there, I have below column that I want to extract the strings with hyphen on the room code, can anyone help here? Many Thanks!

For example here, I want to add a column and export all the FM numbers from Description, such as FM1-325, FM8-525, FM2-710 ect....

NumberDescription
1000000LEAKING VALVE ON BOILERS
1000001FM1-325 LEAK
1000002SINK FM8-525
1000003SINKS FM2-710 2
1000004FM5-807 FR STERI
1000005STUCK FM5-816 SINK
1000006LEAKING FM2-412
1000007FM4-606 TOILET
1000008FM5-816-SINK
1000009WALL FM7-508
 
This is the only item that doesn't match the formats of the other ones. Is there supposed to be a - hyphen before SINK?
FM5-816-SINK
Yes, these are requests raised by different person so really includes so much weird strings! lol they just input whatever they thought in their mind.... 🥹
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
If so,
=TRIM(LEFT(SUBSTITUTE(LET(t,TEXTSPLIT(B2&" "," "),FILTER(t,ISNUMBER(SEARCH("-",t)),"")),"-",REPT(" ",255),2),255))

If not,
=LET(t,TEXTSPLIT(B2&" "," "),FILTER(t,ISNUMBER(SEARCH("-",t)),""))
Learnt ! thank you!🤝👍
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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