Solved

Excel Remove Comma

Posted on 2014-01-13
9
200 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
9 Comments
 
LVL 48

Expert Comment

by:Rgonzo1971
Comment Utility
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 25

Expert Comment

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

Expert Comment

by:MacroShadow
Comment Utility
=SUBSTITUTE(A1,",","")
And drag down as far as necessary.
0
 
LVL 3

Author Comment

by:Computer Guy
Comment Utility
I like this: =SUBSTITUTE(A1,",","")

But how do I make Morrison, Van into Van Morrison
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 26

Expert Comment

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

Author Comment

by:Computer Guy
Comment Utility
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 26

Expert Comment

by:MacroShadow
Comment Utility
Go with Rgonzo1971's solution.

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

Author Comment

by:Computer Guy
Comment Utility
Sure.
0
 
LVL 26

Accepted Solution

by:
MacroShadow earned 500 total points
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now