• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Complicated right function

Guys,

I want to use a =Right() function on some text to extract the text from a word. All words are written like this " - Bank" and I want to transfer that to just "Bank". This can obviously be done by a simple =right(a2;4) function but problem is that the bank values differ. I also have

- Divisie
- International

etc... So i cant just use a normal right function. I need a function doing something like: get the third till the last letter.

Anybody help on how I can fix this?

Thanks!

Marc
 
I uploaded the file. It's about all the values in column G. I want to get rid of all the " - " before the texts...
 

Attachments

  • 20140214_MDW_voor_senssterren_database_31-01-2014.zip
    790.7 KB · Views: 14
You only want to replace " - " from column G and get the values in new column say
- Bestuursbureau
should become
Bestuursbureau
Regards,
 
If your going to be doing this regularly a formula like
=RIGHT(G2,LEN(G2)-FIND("- ",G2)-1)
will do the job

If your going to just do it once I'd use Text to Columns
Goto Data, Text to Columns, Fixed Width
Adjust Columns separators to suit
 
One more formula approach which should work with your data:
=TRIM(SUBSTITUTE(G2,"-","",1))


Select Column G and do Find And Replace with
Find : " - " <--Without Quotes
Replace: Keep it blank
And do replace all.
 
An for the lazy guys like me, select the cells to change - Ctrl+H
replace what "- " ( no quotes)
replace with ( leave blank)
Click replace All - Done
 
Back
Top