• 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.

Removing numbers from cell

jacques

New Member
Hi

I use SharePoint quite frequently and sometimes need to display the data in an Excel dashboard. By the way, Chandoo, thanks for all the dashboard tips!

When I export PeoplePicker fields from SharePoint into Excel the results look like this when multiple people have been picked in the SharePoint list:

Ben Kingsley; #457; David Tenant; #71; Peter O'Toole; #4210

I want to remove all of the unwanted identification values as well as the preceding semicolon, e.g. "; #457" and only want to be left with the names delimited by semicolon:

Ben Kingsley; David Tenant; Peter O'Toole;

This is my current formula with the relevant information in cell A1 (by the way, I have also removed the very last semicolon):

=LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"0",""),"9",""),"8",""),"7",""),"6",""),"5",""),"4",""),"3",""),"2",""),"1",""),";#;#","; "),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"0",""),"9",""),"8",""),"7",""),"6",""),"5",""),"4",""),"3",""),"2",""),"1",""),";#;#","; "))-2)

I am sure there is a better way than using multiple nested substitute functions. I can use VBA, there are several posts on this as well as on UDF's, however I would like to do this using formulas only.

Any ideas?
 
Hi, jacques!
Glad you help you, even if it wouldn't solve your issue, I guess. Welcome back whenever needed or wanted.
Regards!
 
You could cut down some SUBSTITUTE portion for sure. Following should give the same result.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"0",""),"9",""),"8",""),"7",""),"6",""),"5",""),"4",""),"3",""),"2",""),"1",""),"; #;",","),"; #","")
 
Back
Top