# Thread: Extracting using the RIGHT function (XP)

1. ## Extracting using the RIGHT function (XP)

What I am attempting to do is extra the information in the parenthesis in order to sort by job classification. I thought that the RIGHT Function might be suitable, but it gives me the workers first name along with the job classification. Is there a method of being able to extract what is in the parenthesis in order to do the sort?

2. ## Re: Extracting using the RIGHT function (XP)

Try

=MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1)

in B1, and fill down as far as needed.

3. ## Re: Extracting using the RIGHT function (XP)

Thanks Hans. This works well. When you have sometime would mind explaining the functioning of FIND("(" where it is used.

4. ## Re: Extracting using the RIGHT function (XP)

FIND(a, looks for the first occurrence of (the value of) a in (the value of) b, and returns the position of this first occurrence. So for example FIND("o", "Woody") returns 2 because the first occurrence of "o" in "Woody" is in the second character. And FIND("o", "Gates") returns an error because "o" is not found in Gates.

The search is case-sensitive; if you want a case-insensitive search use SEARCH instead of FIND.

If you look up FIND and SEARCH in the Excel help, you'll find more detailed information.

5. ## Re: Extracting using the RIGHT function (XP)

Another option :

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

Or this one, only in saving some keystrokes

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

Regards
Bosco

6. ## Re: Extracting using the RIGHT function (XP)

Hi Bosco

Is it working at your end? I tried the formula provided but its return #VALUE..... not sure why

Thanks

regards,

7. ## Re: Extracting using the RIGHT function (XP)

Are you sure that you entered the formula correctly? I have attached your workbook with both versions of bosco_yip's formula.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•