+ Reply to Thread
Results 1 to 10 of 10

index / match lookup formula not working

  1. #1
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    index / match lookup formula not working

    I looked this formula up but im getting it wrong somewhere. I'm trying look up the values from the array on sheet2 c3:p173. I use the values in column A and column B on sheet1, if they match the values on sheet2 column A and B then it returns the values in the array on the same row of the match. At least thats what im trying to do.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: index / match lookup formula not working

    In C2, an array formula, copied across & down:

    =INDEX(Sheet2!C$3:C$173,MATCH(1,($A2=Sheet2!$A$3:$A$173)*($B2=Sheet2!$B$3:$B$173),0))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: index / match lookup formula not working

    I see what you did, so i have to use this formula in each cell not on a row of cells. There's not way to have it return the row instead of cell by cell? Just curious.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: index / match lookup formula not working

    No. You set it up in once cell and drag across and down. Your original formula also did not have appropriate anchoring to lock cell references correctly ( the $ s) and didn't specify an exact match (,0 at the end of the MATCH statement).

  5. #5
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: index / match lookup formula not working

    ok that makes since. Thanks. I have a second question if you have time. The data I used comes in 2 forms. How would i adjust the formula if the data used to match was in one cell on one sheet and on 2 cells on another sheet. I'll adjust the example to show what i mean.

    i can use trim to separate them but it would require a separate formula and workspace. If i can do it with one formula that would be nice.

    i tried this but it didnt work
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kevinu; 12-22-2017 at 08:31 PM.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: index / match lookup formula not working

    1. You changed the cell references in INDEX from INDEX(Sheet2!C$3:C$173 back to INDEX(Sheet2!C3:P173. That is incorrect and it will not work.

    2. You left out all of the $ signs in the formula that I used to lock the cell references as you copy/paste. That is incorrect and it will not work.

    3. In sheet 1 column B, all of the entries end in LE. None of the entries in columns A or B in sheet 2 contain LE. So there are no matches to be found.

    4. The values to the left of the - in sheet 1 column B are sometimes to be found in sheet 2 column A (e.g. FP1) sometimes in column B (e.g. Cz) and sometimes in both (F3, F4, etc).

    Please amend sheet 1 column A and repost, explaining which part of the code applies to sheet 2 column A and which part to sheet 2 column B.

  7. #7
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: index / match lookup formula not working

    Glenn, Sorry I copied the wrong data. Here is the way it should look. On sheet 1, column B i have 2 variables in one cell such as fp1 - p4. It needs to look at sheet two and look at column A and B to match. I know how to use Left and Right to get the first or second part but i cant seem to find out how to use in in the formula that also pulls the cell data back. Again sorry for the messed up example. Thanks for you help.
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: index / match lookup formula not working

    In C2, an array formula, copied across and down:

    =INDEX(Sheet2!C$3:C$173,MATCH(1,(Sheet2!$A$3:$A$173=TRIM(LEFT(Sheet1!$B2,SEARCH("-",Sheet1!$B2)-1)))*(Sheet2!$B$3:$B$173=TRIM(MID(Sheet1!$B2,SEARCH("-",Sheet1!$B2)+1,255))),0))

    or (if you prefer) an ordinary formula, copied across and down:

    =INDEX(Sheet2!C$3:C$173,MATCH(1,INDEX((Sheet2!$A$3:$A$173=TRIM(LEFT(Sheet1!$B2,SEARCH("-",Sheet1!$B2)-1)))*(Sheet2!$B$3:$B$173=TRIM(MID(Sheet1!$B2,SEARCH("-",Sheet1!$B2)+1,255))),),0))

    the attached sheet contains the ordinary formula.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: index / match lookup formula not working

    thanks that did the trick

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: index / match lookup formula not working

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] index/match formula not working
    By ea223 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-28-2023, 11:30 AM
  2. [SOLVED] help index and match macro not working but formula working??
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2016, 06:37 AM
  3. [SOLVED] Lookup with mutiple criteria - Vlookup, Match, index not working
    By PM1985 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-17-2014, 07:10 AM
  4. [SOLVED] Index/match formula not working
    By nawGo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-21-2014, 10:56 AM
  5. [SOLVED] Working INDEX MATCH with SEARCH, but I need to add another MATCH to the formula!
    By DaveBre in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-11-2014, 01:03 AM
  6. Correct/Working (Index,Match) formula not working between cells
    By barnerd in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-11-2014, 01:20 PM
  7. Hello - I'm working with a 2-way lookup likely using Index & Match
    By CM_Marsh in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-13-2012, 11:15 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