Hi everyone - Is there a way to ONLY extract data from between 2 parenthesis if the data is a number? See attached workbook.
Hi everyone - Is there a way to ONLY extract data from between 2 parenthesis if the data is a number? See attached workbook.
In C2 copied down:
=IFERROR(--SUBSTITUTE(MID(A2,FIND("(",A2)+1,99),")",""),"")
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
Into C2:
(As I know from your other post ID are always 6 digits long)
Formula:Please Login or Register to view this content.
and drag it down.
Happy with my answer * Add Reputation.
If You are happy with solution, please use Thread tools and mark thread as SOLVED.
I think you are over-thinking it again ...
Another option, if it's always a 6digit number
=IFERROR(SUBSTITUTE(RIGHT(A2,7),")","")+0,"")
WOW, again both great answers and both worked! You guys are amazing. Thank you so much. I will mark the thread as resolved. Happy new year!
Happy New Year!
Hi everyone - I forgot to add a situation to the example (my apologies). This is another data point
John Smith (10127677)[C]
As you can see, there is a [C] at the end. I also need to ignore that and still extract the 8 digit ID. Can you help me modify the formula? The current one just skips over this record and gives me a blank .
I’m away from the PC now, but will look in again in the morning to see if you still need help.
this is an adjustment to what Ali gave you AND it assumes that if it exists it will always be [C]...
=IFERROR(--SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("(",A2)+1,99),")",""),"[C]",""),"")
Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
Sam Capricci
Thanks for the assist, Sam.
You're welcome Ali, I was trying to come up with my own when you already posted and I was also over thinking it and yours looked so efficient. A little tweak wasn't much to add.
Just in case if ID change to 7 or 9 and something like [X] or [DF] appear:
Formula:Please Login or Register to view this content.
This is a bit shorter:
=IFERROR(--TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("(",A2)+1,99),")",""),"[",REPT(" ",99)),98)),"")
Thank you everyone! Worked like a charm. I'll mark this as resolved.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks