+ Reply to Thread
Results 1 to 5 of 5

Vlookup/Match - Read Data from 1 table using a value from another

  1. #1
    Registered User
    Join Date
    06-27-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    13

    Lightbulb Vlookup/Match - Read Data from 1 table using a value from another

    Hi All,

    I am stuck.

    My wish is to have column G match a value entered on a different worksheet.

    Once there is a match I would like column E to be read in alignment to the relevant values in Column G.

    From here I want column E to look for an exact match in Column B.

    Column B then reads the number of times that value appears & prints that in a cell. (how many times the value from column E appears in column B)

    It is also to print the relevant values in Column C
    ....................................................................
    I have attached an example worksheet.

    Many thanks

    Oblah
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,617

    Re: Vlookup/Match - Read Data from 1 table using a value from another

    Range Names:
    OrgID_B =Sheet1!$B$2:$B$10
    OrgID_E =Sheet1!$E$2:$E$10
    UniqueID =Sheet1!$G$2:$G$7

    Course Counter:
    Please Login or Register  to view this content.
    Course Names List:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    06-27-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    13

    Re: Vlookup/Match - Read Data from 1 table using a value from another

    This has worked. Thank you very much.

    If you could, could you elaborate slightly on the functionality of ROW in this context. I have never used that functionality before.

    Thanks again - this has helped me a lot.

    Oblah.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,617

    Re: Vlookup/Match - Read Data from 1 table using a value from another

    Sorry for the delay!


    The SMALL function returns the k-th smallest value in a data set.
    The syntax is: SMALL(array,k)

    The formula in A9:A21, is
    =IFERROR(INDEX(Sheet1!$A$1:$G$10,SMALL(IF(Sheet1!$B$1:$B$10=INDEX(Sheet1!$E$2:$G$10,MATCH($A$3,Sheet1!$G$2:$G$10,0),1),ROW(Sheet1!$C$1:$C$10)),ROW()-8),3),"")

    The array is built with:
    =IF(Sheet1!$B$1:$B$10=INDEX(Sheet1!$E$2:$G$10,MATCH($A$3,Sheet1!$G$2:$G$10,0),1),ROW(Sheet1!$C$1:$C$10))

    The condition test for the IF function:
    Sheet1!$B$1:$B$10=INDEX(Sheet1!$E$2:$G$10,MATCH($A$3,Sheet1!$G$2:$G$10,0),1)

    tests the values in the 10 rows of column B against the value returned from Index/match, and builds an array of True and False values.
    The value to return if True is evaluated with: ROW(Sheet1!$C$1:$C$10)), Here it returns to array {1,2,3,...,10}

    Using the ID number in your test file, 147785, Index returns 2787, which is found in row 5 & 6 of column B..

    So, the IF function returns the array {False,False,False,False,5,6,False,False,False,False} to the SMALL function.

    The second parameter of the SMALL function, vis., "k", specifies which relative value in the array to return; in this case #1. I used Row(C1) to specify row 1 because I wanted to drag the formula down to row 21. Notice that I could have hard coded "1" in the formula instead. But that would require manually editing each formula with 2,3,...
    Also, since the first formula is in column A, row 9, and I wanted the first smallest number, I could have used ROW()-8. However it was easier to use ROW(C1) (Note that any cell in the first row, A1, B1,... would also work).

    Finally, SMALL returns 5 and 6 to the INDEX for the first two rows for that particular ID number.
    Last edited by protonLeah; 09-06-2017 at 11:43 PM.

  5. #5
    Registered User
    Join Date
    06-27-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    13

    Re: Vlookup/Match - Read Data from 1 table using a value from another

    Many thanks for all of this help ProtonLeah!

+ 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] Vlookup to Pivot Table, using Match function, returns error if can't find match value
    By AndrewHowarth in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-16-2015, 12:10 AM
  2. Replies: 2
    Last Post: 12-18-2014, 09:52 AM
  3. Replies: 3
    Last Post: 05-19-2014, 02:01 PM
  4. Replies: 1
    Last Post: 08-31-2012, 10:35 PM
  5. Replies: 4
    Last Post: 11-10-2011, 04:43 AM
  6. Excel 2007 : How to Read RSS/XML into Data Table?
    By ice1000 in forum Excel General
    Replies: 0
    Last Post: 06-25-2011, 07:10 PM
  7. Macro: open file, read data, create table, vlookup
    By doctorspears in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2011, 12:54 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