Home

Find and replace? Delete some characters but leave others?

Brian Jarvis
Occasional Visitor

Hello, All!

 

I'm trying to do a find & replace that would turn this:

       someText(25)

into:

       25

 

The 25 could be any number value. Basically, I want to delete "someText(" and the the last parenthesis. Can I use find & replace to do this? Thanks!

2 Replies

Hi Brian,

 

can you try this one?

=REPLACE(REPLACE(A1,1,FIND("(",A1),""),FIND(")",REPLACE(A1,1,FIND("(",A1),"")),100,"")

 

Thanks,

kenkie

Highlighted

Brian,

 

If you have Excel 2013 or later then the best way to clean your data is to use the Flash Fill.

 

For example, imagine that you have some data in range A1:A21 as shown in the below screenshot,

and you want to extract the numbers only, in cell B1 type 82,

then step down to cell B2 and press Ctrl+E.

 

Flash Fill.PNG

 

If you have Excel 2010 or earlier, use this formula:

=SUBSTITUTE(REPLACE(A1,1,SEARCH("(",A1),""),")","")

 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
50 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
32 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
15 Replies
Dev channel update to 80.0.355.1 is live
josh_bodner in Discussions on
67 Replies