+ Reply to Thread
Results 1 to 6 of 6

lookup an array in a row in a index and return a value if array matches any row in index

  1. #1
    Registered User
    Join Date
    11-24-2015
    Location
    China
    MS-Off Ver
    2013
    Posts
    8

    lookup an array in a row in a index and return a value if array matches any row in index

    In the attached I have used numbers to illustrate what I want. in the first row I have 1 2 3 4 (A1~D1), starting in F1~I3 I have created a simple index, and at the end of those rows i have a corresponding number to indicate the value of each indexed row. What I want to do here is compare A1, A2, A3, A4 to F1:I3 index, if the numbers in A1~A4 macth exactly any row the value in M1:M3 should return in J1. This is waht I have tried.
    =IF(AND(A1=F1,B1=G1,C1=H1,D1=I1),M1,"")&IF(AND(A1=F2,B1=G2,C1=H2,D1=I2),M2,"")&IF(AND(A1=F3,B1=G3,C1=H3,D1=I3),M3,"")
    This works, but I have 100's of number configurations in my index and it becomes too cumbersome to create the formula and excel runs of formula availability before all is entered.
    i would like to do this same function in VBA but with a 1000 row index referenced.
    Can someone help me with this?

    Thank you

    Plrod
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: lookup an array in a row in a index and return a value if array matches any row in ind

    Try:

    =LOOKUP(2,1/($F$1:$F$3=A1)/($G$1:$G$3=B1)/($H$1:$H$3=C1)/($I$1:$I$3=D1),$M$1:$M$3)
    Quang PT

  3. #3
    Registered User
    Join Date
    11-24-2015
    Location
    China
    MS-Off Ver
    2013
    Posts
    8

    Re: lookup an array in a row in a index and return a value if array matches any row in ind

    I tried but after entering it as shown above it return an N/A (with 1234in cel abcd) and a div by o error if any other numbers are entered into abcd

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: lookup an array in a row in a index and return a value if array matches any row in ind

    Formula works OK for me with your supplied sample file - 5000 was placed in J1.

    Error conditions can be "removed" by using

    =IFERROR(LOOKUP(2,1/($F$1:$F$3=A1)/($G$1:$G$3=B1)/($H$1:$H$3=C1)/($I$1:$I$3=D1),$M$1:$M$3),"")

    Entering 5,6,7,8 in A1 to A4 resulted in blank using the above.

    If you used a different set of data, please post here.

  5. #5
    Registered User
    Join Date
    11-24-2015
    Location
    China
    MS-Off Ver
    2013
    Posts
    8

    Re: lookup an array in a row in a index and return a value if array matches any row in ind

    Great! that works! Many thanks!

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: lookup an array in a row in a index and return a value if array matches any row in ind

    If the problem is fixed, could you please mark the thread as SOLVED ("Thread Tools" at top of first post). Thank you.

+ 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] Match-Index in stead of Index-Match lookup Array among Arrays
    By Numnum in forum Excel General
    Replies: 2
    Last Post: 10-15-2015, 02:08 PM
  2. [SOLVED] 2 Column Lookup with 6 Column array Col index number is Varies Within Entire Array
    By Weasyb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-05-2015, 12:54 PM
  3. Replies: 4
    Last Post: 05-19-2015, 08:42 PM
  4. [SOLVED] Index an array, return most recent repair, first three letters lookup
    By Martin Chamberlin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-16-2014, 08:57 AM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Replies: 6
    Last Post: 04-12-2013, 05:50 AM
  7. [SOLVED] INDEX MATCH array formula that matches substring n gives multiple matches
    By bkwins in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2013, 04:57 AM

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