+ Reply to Thread
Results 1 to 8 of 8

Replace names with numbers

  1. #1
    Registered User
    Join Date
    06-27-2023
    Location
    BHC, AZ
    MS-Off Ver
    Office 2016
    Posts
    3

    Replace names with numbers

    Good evening,

    I'm not even sure how to phrase my question but here's what we're trying to accomplish. My job entails submitting data from spreadsheets. The data comes to my office in the form of spreadsheets with names next to each set of data. The data we submit can't show names so we replace the names with the corresponding ID numbers from a separate spreadsheet. How do I tell the spreadsheet with the names to replace each name with it's corresponding number? Right now we're doing the corrections manually. I hope this makes sense and I greatly appreciate any assistance.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,690

    Re: Replace names with numbers

    if one sheet has both the names and numbers on it you can do a vlookup, xlookup (provided that your excel is new enough) or index match against the sheet and that should simplify things for you. If it doesn't and you can create a list you can then do this easily enough without doing it manually. However without some sample workbooks we will just be guessing.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Replace names with numbers

    You wont be able to actually replace the names with numbers, but what you can do is use a helper to ID the number associated with the name using something like vlookup(), then value those formulas (so only numbers are left) and delete the orginal names.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,006

    Re: Replace names with numbers

    Or you can use Find & Replace for each value.

    Seeing a sample workbook would help to consolidate our advice, but I think you will end up going down the VBA route with this one.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    06-27-2023
    Location
    BHC, AZ
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Replace names with numbers

    Thank you all for your replies.
    I'm not able to upload actual spreadsheets because of privacy laws so I put together a quick spreadsheet that hopefully will explain our issue.
    I really do appreciate your time.
    Attached Files Attached Files

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Replace names with numbers

    you can use Power Query (Get&Transform) but your example should show real structure without your comments in

    eg. the result like this

    STUDENT IDENTIFICATION NUMBER Student
    Name
    Test A
    Score
    Test B
    Score
    Test B
    Score2
    Test B
    Score3
    87654321
    Mary Smith
    23
    14
    450
    1
    98765432
    John Jones
    57
    9
    345
    2
    Attached Files Attached Files
    Last edited by sandy666; 06-29-2023 at 04:31 PM.

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,690

    Re: Replace names with numbers

    are these the results you are looking for??? check rows 10 and 11 where the names were replaced with the student ID (SID) numbers and the grades were brought over to match the SID. I used index/match formulas in A11 and A12 and C11 through F12.
    the formulas were variations of this index/match formula and you can see in them in your uploaded attachment...
    =INDEX($A$17:$A$18,MATCH(B7,$B$17:$B$18,0))
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-27-2023
    Location
    BHC, AZ
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Replace names with numbers

    Yes, thank you!!

    Our spreadsheet will have approx 1500 names. I'm going to play around and see if I can get it to work for us.

    I really appreciate your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Replace present formula names with reference data sheet names list
    By Khaldon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-05-2021, 09:41 AM
  2. Replies: 1
    Last Post: 08-30-2017, 12:09 AM
  3. [SOLVED] Replace all names with random names
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-28-2012, 05:47 PM
  4. [SOLVED] Pivot: Replace month numbers with month names and sort by fiscal year
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2011, 02:13 PM
  5. Replies: 6
    Last Post: 04-21-2011, 03:49 PM
  6. Replace bad names from a list of good names
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-15-2009, 01:39 PM
  7. Replies: 3
    Last Post: 05-11-2005, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1