Solved

Excel: First name first and Comma deletion

Posted on 2014-09-17
10
144 Views
Last Modified: 2014-09-17
Hall, Bill
jones, Marcia
Smith, Scott

in excel, how do I make first name first and get rid of the commas?

D
0
Comment
Question by:dlewis61
  • 5
  • 3
  • 2
10 Comments
 
LVL 6

Expert Comment

by:Russell Lucas
ID: 40328321
In 2013 you can use flash fill simply by putting the name to correct way next to the first row and clicking the flash fill button.

In formula it's:-

=CONCATENATE(RIGHT(A1,LEN(A1) - FIND(",",A1) - 1)," ",LEFT(A1,LEN(A1) - FIND(",",A1) - 1))
0
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40328346
Here is a macro you can use. Change the DATA_COL constant to the coumn where the data is.

Sub UpdateNames()
Dim lngLastRow As Long
Dim lngRow As Long
Dim strParts() As String
Const DATA_COL = "A"

lngLastRow = Range(DATA_COL & "65536").End(xlUp).Row

For lngRow = 1 To lngLastRow
    strParts = Split(Cells(lngRow, DATA_COL).Value, ",")
    If UBound(strParts) > 0 Then
        Cells(lngRow, DATA_COL).Value = strParts(1) & " " & strParts(0)
    End If
Next

End Sub

Open in new window

0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40328365
Russell, for some reason your formula leaves the comma at the end of "Marsha Jones,".
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40328371
It also changes "Diddlehopper, John" to  "John Didd".
0
 

Author Comment

by:dlewis61
ID: 40328387
I find that it leaves a zero...
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 46

Expert Comment

by:Martin Liss
ID: 40328397
I find that it leaves a zero...
What does?

If there's a problem with my code then please attach your workbook.
0
 

Author Closing Comment

by:dlewis61
ID: 40328409
OMG Can't believe it!! The code worked!! Thanks
D
0
 
LVL 6

Expert Comment

by:Russell Lucas
ID: 40328411
You're absolutely right I made a mistake there, here is the correction:-

=CONCATENATE(RIGHT(A1,LEN(A1) - FIND(",",A1) - 1)," ",LEFT(A1,FIND(",",A1)-1))
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40328502
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
0
 

Author Comment

by:dlewis61
ID: 40328874
Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

929 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

14 Experts available now in Live!

Get 1:1 Help Now