0
votes

I'm fairly new to using Power BI, and tried searching to see if this has been answered previously, but couldn't find anything that matched exactly what I'm looking for.

I have a column of data that includes project names and an ID number in parentheses. Example: John's Project (12345)

I'm trying to extract just the ID number, but the issue I'm running into is that some rows have other numbers outside the parentheses so I can't rely on just pulling out any numeric characters, and some rows may have multiple sets of parentheses so I can't rely on just selecting text between two delimiters.

Sample data:

ProjectTitle
John's Project (12345)
Website redesign 2021 (98765)
New Accounting System (NAS) (45645)
Customer Service Contact Form (32198) (On Hold)

In each case, I want to copy the five-digit number into a separate column. Is there an easy way to do this when the text could sometimes have other numbers and/or other text inside of parentheses, which could come before or after the parentheses I'm interested in?

Thanks for any assistance!

1

1 Answers

0
votes

What about

=MID([ProjectTitle], SEARCH("(?????)", [ProjectTitle]) + 1, 5)

This searches for the position of five characters surrounded by parentheses, and then extracts five characters from the next position (i. e. ignoring the opening parenthesis)-