+ Reply to Thread
Results 1 to 7 of 7

Help with replacing values.

Hybrid View

igolfniray Help with replacing values. 04-13-2012, 02:47 PM
DGagnon Re: Help with replacing... 04-13-2012, 02:54 PM
FDibbins Re: Help with replacing... 04-13-2012, 02:58 PM
igolfniray Re: Help with replacing... 04-13-2012, 03:25 PM
igolfniray Re: Help with replacing... 04-13-2012, 03:03 PM
Marcol Re: Help with replacing... 04-13-2012, 03:36 PM
FDibbins Re: Help with replacing... 04-13-2012, 03:39 PM
  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    Belfast
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Lightbulb Help with replacing values.

    I have a list of text values each have a category number i.e

    Col1 || Col2
    1508 || John Smith
    1508 || Jane Doe
    1509 || John Doe
    1509 || Jane Smith
    1510 || Robert Smith

    And another two columns relating the category number i.e.

    Col1 || Col2
    1508 || Solicitors
    1509 || Teachers
    1510 || Drivers

    I have 30,000 names and 1500 categories.

    I need my sheet to end up like this:

    Col1 || Col2
    Solicitors || John Smith
    Teachers || John Doe

    So I need to search i.e "1508" and replace it with the text associated with it.

    I know it can be done with search>replace all but I have 1500 categories... I need something automatic!

    Can anyone help me with this?

    Thanks in advance!

    Ray
    Last edited by igolfniray; 04-13-2012 at 03:45 PM. Reason: More info

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Help with replacing values.

    the best way to do this would be by putting a vlookup formula in Col"3" then after it finds all of the values to paste it over the Col1 data

    =VLOOKUP(A1,E:F,2,0)

    where A contains your first table with numbers, B the names, and range E:F has your second table with the numbers and categories.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  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: Help with replacing values.

    it would be easier to help if you uploaded a sample file, but if i understand your layout, a vlookup() will do what you want. Unsure tho if the below is in the same cell, or 2 different cells
    Col2 || Col2
    1508 || Mr. John Smith

    assuming they are not, and A2=1508 and "name" = B2 (sheet1)....1508=A2, "category"=B2 (sheet2), where you want your answer, try...
    =vlookup(sheet1!A2,sheet2!A2:B30000,2,false)

    let me know how this works for you
    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
    Registered User
    Join Date
    04-13-2012
    Location
    Belfast
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Re: Help with replacing values.

    I just tried this and it worked perfectly! Thank you kindly.

    It's great when people share knowledge like this!

  5. #5
    Registered User
    Join Date
    04-13-2012
    Location
    Belfast
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Re: Help with replacing values.

    Yes... you were right... sorry that was a typo!

    Fixed it now...

    I'll give this a go an report back.

    Thank you for the swift reply!

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with replacing values.

    This should also work. Copy the result and paste special > Values if required.
    Attached Files Attached Files
    Last edited by Marcol; 04-13-2012 at 03:39 PM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    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: Help with replacing values.

    Glad to help, please mark this post as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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