Solved

Excel: First name first and Comma deletion

Posted on 2014-09-17
10
148 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
[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
  • 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 47

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 47

Expert Comment

by:Martin Liss
ID: 40328365
Russell, for some reason your formula leaves the comma at the end of "Marsha Jones,".
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 47

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 47

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 47

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel formula to calculate ID # 4 43
EXCEL String-handling question ... 7 54
Excel -  lookup two values and return a value 3 30
need count all combination 31 32
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

738 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