+ Reply to Thread
Results 1 to 4 of 4

Table relationships in Excel?

  1. #1
    saturnius
    Guest

    Table relationships in Excel?

    Hello,
    I have an excel file exported from SQL server. There are two tables
    1. User (columns: id, name, address, etc)
    2. Tasks (columns: id, userid, description)

    Is there a way to display the user NAME insead of the ID in the tasks table?
    Many thanks in advance! Saturnius

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    I will assume the ID fields in both tables match. You could then use VLOOKUP in the Task table to find the associated "Name" from the User table (name this table's range "User") (also, make sure the User table is sorted ascending, by ID number)

    Add a helper column next to your ID column in your Task table and enter this formula in the top cell of that new column:

    =VLOOKUP(CR,User,2,FALSE)

    substitute your Task ID cell reference for "CR". Using FALSE will return #N/A if no exact match is found. Also note this formula assumes the Name is in the second col. of your User table.


    Good Luck
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Adam
    Guest

    RE: Table relationships in Excel?

    You could do a vlookup on the linked field. If id is the same in both tables
    use a vlookup function

    "saturnius" wrote:

    > Hello,
    > I have an excel file exported from SQL server. There are two tables
    > 1. User (columns: id, name, address, etc)
    > 2. Tasks (columns: id, userid, description)
    >
    > Is there a way to display the user NAME insead of the ID in the tasks table?
    > Many thanks in advance! Saturnius
    >


  4. #4
    Dave Peterson
    Guest

    Re: Table relationships in Excel?

    Maybe =vlookup() or =index(match()).

    Visit Debra Dalgleish's site:
    http://www.contextures.com/xlFunctions02.html
    and
    http://www.contextures.com/xlFunctions03.html

    for some nice instructions.




    saturnius wrote:
    >
    > Hello,
    > I have an excel file exported from SQL server. There are two tables
    > 1. User (columns: id, name, address, etc)
    > 2. Tasks (columns: id, userid, description)
    >
    > Is there a way to display the user NAME insead of the ID in the tasks table?
    > Many thanks in advance! Saturnius


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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