+ Reply to Thread
Results 1 to 4 of 4

Extract data from specified id

Hybrid View

  1. #1
    Registered User
    Join Date
    07-23-2008
    Location
    Los Angeles
    Posts
    2

    Extract data from specified id

    Hi, I'm new to excel programming and will start learning today.

    My first task is to extract data by entering an id number in a cell that would pull data corresponding to the ID.

    Cell A1 contains the ID numbers which is 1.
    Cell B1 contains the data corresponding to the ID number which is data of 100.

    I need to do this:
    Cell D1 enter an ID number (example: 1)
    Cell E2 will see result of 100.

    I have many many rows of data and would like such a function to retrieve data when entering a ID number to retrieve data corresponding to that ID.

    How would I do this? I tried playing with simple excel if then statements but it won't nearly do what I need. Help!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    If I understand your requirement, try a VLOOKUP function in E2 as follows

    =VLOOKUP(D1,A:B,2,False)

    HTH

  3. #3
    Registered User
    Join Date
    07-23-2008
    Location
    Los Angeles
    Posts
    2
    That works!

    Hm... could you explain to me what the 2 and false means?
    Thanks

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Your original post defined a two column table where the ID No was in col A and the data relevant to the ID no is in the second column B. The '2' you're asking about refers to the 2nd column of the defined range, i.e. col B.

    The False is an optional third element in VLOOKUP() and HLOOKUP() functions. By specifying this you are asking the VLOOKUP() to find an Exact Match. Without it the formula will find the highest value which is nearest to but less than the subject value of the VLOOKUP, i.e it will always find a result but not necessarily the value you are looking for.

    HTH

+ 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