+ Reply to Thread
Results 1 to 7 of 7

Combining MID, MATCH and INDIRECT

  1. #1
    Registered User
    Join Date
    06-02-2021
    Location
    Norway
    MS-Off Ver
    Office 2019
    Posts
    12

    Combining MID, MATCH and INDIRECT

    What is wrong here?
    I thought I got it right when combining MATCH and INDIRECT (Big Thanks; Croweater!), and on the Summary sheet attached, the code applied to A2:H4 is correct.
    But when similar code is applied to Summary sheet AQ4:AZ6, it does not work?

    The code that works in CELL D2:
    =MID("abc",MATCH("x",INDIRECT("'"&$A2&"'!G"& MATCH(D$1,INDIRECT("'"&$A2&"'!E3:E7"),0)+2&":I"&MATCH(D$1,INDIRECT("'"&$A2&"'!E3:E7"),0)+2),0),1)

    The code that doesn't work in CELL AQ4:
    =MID("abc",MATCH("x",INDIRECT("'"&$L4&"'!I"& MATCH(AQ$2,INDIRECT("'"&$L4&"'!G47:G82"),0)+2&":K"&MATCH(AQ$2,INDIRECT("'"&$L4&"'!G47:G82"),0)+2),0),1)

    Summary sheet A10:J13 shows how AQ4:AZ6 should look like.
    Please note the order of G47:G56 (1,2,3,4,7,6,5,8,10,9).
    Attached Files Attached Files
    Last edited by Bartonsen; 06-03-2021 at 11:30 AM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,956

    Re: Combining MID, MATCH and INDIRECT

    The +2 was to account for the first row of your table being in row 3 - so change the +2 to +46 because your first row of the table is 47:


    =MID("abc",MATCH("x",INDIRECT("'"&$A11&"'!I"& MATCH(B$10,INDIRECT("'"&$A11&"'!G47:G56"),0)+46&":K"&MATCH(B$10,INDIRECT("'"&$A11&"'!G47:G56"),0)+46),0),1)

    If your column G would not have any matches other than in your table, you could look at the entire column without an offset:

    MATCH(B$10,INDIRECT("'"&$A11&"'!G47:G56"),0)+46
    MATCH(B$10,INDIRECT("'"&$A11&"'!G:G"),0)
    Last edited by Bernie Deitrick; 06-03-2021 at 12:40 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-02-2021
    Location
    Norway
    MS-Off Ver
    Office 2019
    Posts
    12

    Re: Combining MID, MATCH and INDIRECT

    Fantastic Bernie! Thanks a lot!

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Combining MID, MATCH and INDIRECT

    With not many sheets I would use Choose

    =MID("abc",MATCH("x",INDEX(VLOOKUP(B$10,CHOOSE(MATCH($A11,$L$4:$L$6,),'steven little'!$G$47:$K$56,john!$G$47:$K$56,'tom jones'!$G$47:$K$56),{3,4,5},),),),1)

    instead of Volatile INDIRECT

    =MID("abc",MATCH("x",INDEX(VLOOKUP(B$10,INDIRECT("'"&$A11&"'!G47:K56"),{3,4,5},),),),1)
    Attached Files Attached Files

  5. #5
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Combining MID, MATCH and INDIRECT

    Why have you posted EXACTLY the same problem which I have already answered in detail here?

    https://www.excelforum.com/excel-gen...ml#post5525292

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,956

    Re: Combining MID, MATCH and INDIRECT

    It is not the EXACT same problem - he was asking for your solution to be applied to a different range, and was having problems doing that.

  7. #7
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Combining MID, MATCH and INDIRECT

    of course it's the same 'problem'! What would happen if everyone created a new thread when they couldn't apply a formula to a different range?
    Isn't that why there is a 'forum rule' for this?

    He asked the same question in the original thread too, but this time couldn't be bothered waiting for an answer, so just created a new thread.

    This leads to people (i.e. me) wasting their time 'solving' problems on one thread that have already been solved on a new one!
    Last edited by Croweater; 06-04-2021 at 07:41 PM.

+ 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] Combining indirect with match
    By Bartonsen in forum Excel General
    Replies: 4
    Last Post: 06-03-2021, 08:01 PM
  2. combining INDIRECT in one formula?
    By Smellyelly in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-01-2021, 11:24 AM
  3. combining 'indirect' function with 'index/match"
    By wongth7 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-20-2015, 09:38 AM
  4. [SOLVED] Combining Sumproduct with indirect
    By pauldaddyadams in forum Excel General
    Replies: 13
    Last Post: 04-29-2015, 07:44 AM
  5. Combining Indirect with Countifs
    By arthurphil in forum Excel General
    Replies: 7
    Last Post: 01-27-2015, 08:13 AM
  6. [SOLVED] INDIRECT Function with multiple sheets - SUMIF, INDIRECT & MATCH
    By DJDRU in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-07-2014, 08:42 AM
  7. Replies: 8
    Last Post: 03-07-2012, 01:35 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