Extracting text after symbol in excel

LauraForiero

New Member
Joined
Oct 6, 2013
Messages
18
HI
Probably simple I just cant figure it out.

I have cell content of a variable length string and I need to extract all text after "!" or "$"

A
Brouillet,Amy Anne!Miss
Dupuis,Jean Paul$Monsieur
Ethier,Guy!Mr
Fu,Guo Qing$Prince
Gowan,Louise Marie$Mademoiselle
McGill,James Patrick!Dr
Robinson,Jacques$Monsieur
Vinet,Jean Pierre!Mr
Voigt,Claire Antoinette$Madame
Wong,Jia$Reverend

<colgroup><col style="width: 159pt; mso-width-source: userset; mso-width-alt: 7753;" width="212"> <tbody>
</tbody>

I know i must use the Right and Find function together but don't know how to. I need 1 single expression for the entire column.
thanks in advance
 
Second quesitons

I have cell content of a variable length string and I need to extract all text between "!" or "$" and the ","

A
Brouillet,Amy Anne!Miss
Dupuis,Jean Paul$Monsieur
Ethier,Guy!Mr
Fu,Guo Qing$Prince
Gowan,Louise Marie$Mademoiselle
McGill,James Patrick!Dr
Robinson,Jacques$Monsieur
Vinet,Jean Pierre!Mr
Voigt,Claire Antoinette$Madame
Wong,Jia$Reverend



<TBODY>
</TBODY>

Again, i need one expression for the entire column
For this question, the following formula is necessarily longer than the one I posted in my last message (#8) above...

=MID(A1,FIND(",",A1&",")+1,FIND("$",SUBSTITUTE(A1&"$","!","$"))-FIND(",",A1&",")-(A1<>""))

but, like my last formula, this one can be copied down past the end of your existing data in anticipation or future data entries.
 
Last edited:
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
As far as I know, you can't use LEFT or RIGHT. You need MID.

Here I am using MID, FIND, and SUBSTITUTE:

Code:
=MID(A2,FIND(",",A2,1)+1,(FIND("!",SUBSTITUTE(A2,"$","!"),1)-FIND(",",A2,1))-1)
 
Upvote 0
is there a way using the right,left,len, find or mid functions?
When you have multiple differeing answers give to a question you post, you should click "Reply With Quote" (and delete unnecessary text for the response you give) instead of just clicking "Reply"... that way, we can see who you are replying to. Right now, I have no idea who the above question was directed to (probably not me because my last message and your last message probably overlapped each other).
 
Upvote 0
is there a way using the right,left,len, find or mid functions?

Like the first one, this is also short:
Rich (BB code):
=REPLACE(LEFT(A2,LOOKUP(9.99999999999999E+307,SEARCH({"!","$"},A2)-1)),1,
  SEARCH(",",A2),"")
You might need to wrap this into an IFERROR call...
Rich (BB code):
=IFERROR(REPLACE(LEFT(A2,LOOKUP(9.99999999999999E+307,SEARCH({"!","$"},A2)-1)),1,
  SEARCH(",",A2),""),A2)
 
Upvote 0
Sorry for the confusion, I am new completely new to this site.

I have a very last question. I now want to extract anything before the ","

Brouillet,Amy Anne!Miss

I would like to extract"Brouillet" from this. Again, how would I do so?
Thank you again! Your answers have been very helpful

When you have multiple differeing answers give to a question you post, you should click "Reply With Quote" (and delete unnecessary text for the response you give) instead of just clicking "Reply"... that way, we can see who you are replying to. Right now, I have no idea who the above question was directed to (probably not me because my last message and your last message probably overlapped each other).
 
Upvote 0
Sorry for the confusion, I am new completely new to this site.

I have a very last question. I now want to extract anything before the ","

Brouillet,Amy Anne!Miss

I would like to extract"Brouillet" from this. Again, how would I do so?
Thank you again! Your answers have been very helpful

=IFERROR(LEFT(A2,SEARCH(",",A2)-1),A2)

would do...
 
Upvote 0
Looking at all of these different solutions (each of which produces the desired result) kind of makes me wonder what the difference is between FIND and SEARCH.

Can anyone shed some light on this?
 
Upvote 0
Looking at all of these different solutions (each of which produces the desired result) kind of makes me wonder what the difference is between FIND and SEARCH.

Can anyone shed some light on this?

FIND does a case-sensitive search, SEARCH doesn't. I believe it's better to invoke the former when case-sensitivity is required, but not when case-indifference for items like 1, comma, etc. upholds. This is conditioned on SEARCH being faster, if that's the case.
 
Upvote 0

Forum statistics

Threads
1,215,411
Messages
6,124,759
Members
449,187
Latest member
hermansoa

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