+ Reply to Thread
Results 1 to 5 of 5

Formula to return a text string from a reference ID

  1. #1
    Registered User
    Join Date
    07-27-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    2

    Question Formula to return a text string from a reference ID

    I have a data using an employee ID number rather than a name, when reporting I am trying to have the name text string appear instead of the employee refID.

    e.g. John Smith is employee 125
    (in all reporting data he is referred to only as 125)

    I have a list of employee names and the refID they have.

    I feel like this should be (and probably is) really simple but I cannot for the life of me get any formula I try to return the name!

    I am actually working in SAP Crystal Reports and generally the data will link automatically for me. All the same rules apply from excel and I will only need to do it once, so I can save it as a subReport. If I don't work it out soon I'm desperate enough to concatenate the two cells and then remove the number component which will just be embarrassing if anyone ever notices! haha

    I know as soon as someone tells me how to get the correct formula I will feel even more ridiculous for not being able to do it but PLEASE HELP!!

    Thank you

    Tegan

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Formula to return a text string from a reference ID

    You can't have it in the same cell as the Ref ID, but you could use VLOOKUP to return the value to am adjacent cell and, maybe, format the Ref IF with a white font to hide it. Well, you could with VBA, but ...


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  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
    52,929

    Re: Formula to return a text string from a reference ID

    hi and welcome to the forum

    Assuming you have a table like this (name 1st, ID 2nd)....
    A
    B
    C
    D
    E
    1
    Name ID
    2
    aa
    111
    ID Name
    3
    bb
    222
    222
    bb
    4
    cc
    333
    5
    dd
    444
    6
    ee
    555


    E3=INDEX(A2:A6,MATCH(D3,B2:B6,0))

    If the ID is 1st, you could use a vlookup() instead...
    A
    B
    C
    D
    E
    10
    Name ID
    11
    111
    aa ID Name
    12
    222
    bb
    222
    bb
    13
    333
    cc
    14
    444
    dd
    15
    555
    ee


    E12=VLOOKUP(D12,A11:B15,2,0)
    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
    07-27-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    2

    Re: Formula to return a text string from a reference ID

    Thanks for the welcome, I'm sure this forum will save me a lot of frustration!

    And thank you so much! Exactly what I needed, worked a treat! You've made my Monday far less painful

  5. #5
    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
    52,929

    Re: Formula to return a text string from a reference ID

    Glad it worked for you, and thanks for the feedback

+ 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. Formula to find and return text string within a cell full of text strings
    By LightingPop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2013, 11:45 PM
  2. [SOLVED] Formula to return a word from string of text
    By kenadams378 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-28-2013, 05:17 AM
  3. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  4. Can an ARRAY formula return a text string?
    By Skybeau in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-28-2013, 08:26 AM
  5. [SOLVED] Return a formula as text string to a cell
    By Sharon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-18-2006, 12:45 PM

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