Solved

Excel: First name first and Comma deletion

Posted on 2014-09-17
10
145 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

803 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