Solved

Excel Remove Comma

Posted on 2014-01-13
9
214 Views
Last Modified: 2014-01-16
Hi,

Some cells have a one name artist such as Journey, where others have Clapton, Eric (Row A)

How can I do an =(A1code) that I can run on Row B (even single named artists) to make it

Journey              Journey
Clapton, Eric     Eric Clapton
0
Comment
Question by:Computer Guy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 39776476
Hi

you could try this formula

=IF(ISERROR(SEARCH(",",A1)),A1,MID(A1,SEARCH(",",A1)+2,LEN(A1))&" "&LEFT(A1,SEARCH(",",A1)-1))

Open in new window


or XL 2007 and further
=IFERROR(MID(A1,SEARCH(",",A1)+2,LEN(A1))&" "&LEFT(A1;SEARCH(",",A1)-1),A1)

Open in new window


Regads
0
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 39776477
You can use the FIND method wrapped in an ISERROR method, something like:
=IFERROR(LEFT(A1, FIND(",", A1)), A1)
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39776493
=SUBSTITUTE(A1,",","")
And drag down as far as necessary.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 3

Author Comment

by:Computer Guy
ID: 39779681
I like this: =SUBSTITUTE(A1,",","")

But how do I make Morrison, Van into Van Morrison
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39779744
Sorry missed that part.
=SUBSTITUTE(MID(A1&" "&A1,FIND(" ",A1)+1,LEN(A1)),",","")
0
 
LVL 3

Author Comment

by:Computer Guy
ID: 39779897
If it is a one word band like Journey, it shows up with #VALUE!

If it is a 3 word band like Black Eyed Peas, it shows up as Eyed Peas Black

Is there a way to ignore those kinds?
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39779937
Go with Rgonzo1971's solution.

If you're interested I can give you a VBA solution.
0
 
LVL 3

Author Comment

by:Computer Guy
ID: 39779938
Sure.
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39781528
If you're interested if a vba solution, try this. Copy the code into a standard module.

Function ReverseString(rngString As Range, Optional strDelim As String = ",") As String
    Dim vStrings As Variant, lngString As Long
    vStrings = Split(rngString, strDelim)
    For lngString = UBound(vStrings) To LBound(vStrings) Step -1
        ReverseString = ReverseString & strDelim & vStrings(lngString)
    Next lngString
    ReverseString = Replace(Replace(ReverseString, strDelim, " ", 1, 1), ",", "")
End Function

Open in new window


And use it like this:
=ReverseString(A1)

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question