+ Reply to Thread
Results 1 to 12 of 12

Can't figure out proper use of Index/Match to solve this problem

  1. #1
    Registered User
    Join Date
    09-25-2013
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Can't figure out proper use of Index/Match to solve this problem

    Hi everyone.
    I can't figure out how to utilize index/match properly to enable the index to be dependent on another field. I've attached my spreadsheet to this post to provide an example.

    In the spreadsheet, I have Cells B1 & B2 that contain dates and that I want to drive data in cells C7 - S9. The data is kept in cells W1 - AT59.

    Rows 7 - 9 contain the correct data using manual index/match formulas. If we were to take cells C7:C9 as an example, there are three parts of my data:
    1. The Date in cell B2 is looked up in Column W
    2. The Category in cell B7:B9 is looked up in Column X
    3. The value in c5 SHOULD look up in Columns Y - AT based on the values in the headers of Y2:AT2

    I'm asking to see if someone can help populate the data in rows 14 - 16 using a smarter formula that references the market that is listed in row 12 versus me having to hard-code the formulas.

    I hope I explained this correctly. Feel free to ask clarifying questions.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,794

    Re: Can't figure out proper use of Index/Match to solve this problem

    I think this is what you mean:

    =INDEX($Y$2:$AH1027,MATCH(1,($B$2=$W$3:$W1027)*(B7=$X$2:$X1027),0),MATCH(C$5,Dashboard!$Y$2:$AH$2,0))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Can't figure out proper use of Index/Match to solve this problem

    Ali has done all the hard work, but not mentioned it needs to be entered with shift control enter, as it is an array formula, but given you are already using array formula on the example sheetyou probably have noticed that and just done it anyway! Its more if others are looking at the solution in the future

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,794

    Re: Can't figure out proper use of Index/Match to solve this problem

    I didn't mention it because the OP already knows this - his original formula was array entered.

  5. #5
    Registered User
    Join Date
    09-25-2013
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can't figure out proper use of Index/Match to solve this problem

    OMG!! YES YES YES!!

    Thank you VERY much AliGW! This does EXACTLY what I needed!

    Would you be able to explain what this does? I understand the following:
    • INDEX($Y$2:$AH1027 = the index/table that the data will be pulled from
    • MATCH(1,($B$2=$W$3:$W1027)*(B7=$X$2:$X1027),0) = Matches the date in B2 to a date in Column W, Matches the category in B7 to the category in Column X
    • ,MATCH(C$5,Dashboard!$Y$2:$AH$2,0)) = Matches the name of the market in C5 across the headers in from Y2:AH2

    What I can't understand is how the last MATCH works in relation to the greater equation. I'm guessing the first two matches are done first since they are in the first set of parenthesis and then it uses that data to match along the market in Y2:AH2 and gets the info from there. Is that correct?
    Last edited by AliGW; 04-07-2020 at 10:13 AM. Reason: Please don't quote unnecessarily!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,794

    Re: Can't figure out proper use of Index/Match to solve this problem

    I'll try to explain!

    In an INDEX MATCH MATCH you have thee following:

    INDEX - the array from which the result is pulled.
    MATCH - the row match data.
    MATCH - the column match data.

    So, you have pretty much identified what each section does in your post.

  7. #7
    Registered User
    Join Date
    09-25-2013
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can't figure out proper use of Index/Match to solve this problem

    AliGW,
    I should be more clear. What I don't understand is the "MATCH(1,". Why do we put a 1 in there? Does that tell excel that the info contained within is the "first" lookup/check?
    Last edited by AliGW; 04-07-2020 at 10:22 AM. Reason: Please don't quote unnecessarily!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,794

    Re: Can't figure out proper use of Index/Match to solve this problem

    It's because there are two arrays in that section of the formula to identify the matching row. In each of the two arrays, there will be 0 and 1 (FALSE and TRUE). Where there is a 1 in common in the two arrays, it will find its match (1x1=1 - all others will be either 1x0=0 or 0x1=0).

    Use the Evaluate Formula option on the Formulas ribbon to step through the formula to see how it works.

  9. #9
    Registered User
    Join Date
    09-25-2013
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Can't figure out proper use of Index/Match to solve this problem

    Awesome! Thank you for explaining that to me!!
    Last edited by AliGW; 04-07-2020 at 11:38 AM. Reason: Please don't quote unnecessarily!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,794

    Re: Can't figure out proper use of Index/Match to solve this problem

    No worries.

    By the way, please stop all the unnecessary quoting. Thanks.

  11. #11
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Can't figure out proper use of Index/Match to solve this problem

    Hi Bullpen,

    First of all, I pray that you and yours are well and coping with these difficult times.

    I took a different approach, and used OFFSET/MATCH. I noticed that your Current Formula seemed to be giving the wrong answer - not picking up the correct week. Having said that, I see Ali got the same answers as you, but I don't understand why. I must be missing something.

    The second thing I noticed, the data is consistent in that it always has the three components, so looking up Not Started, In Progress etc in the data was not necessary. It is always one, two or three cells removed from the first time the date is found.

    This is the formula I came up with. It can be entered into C14 and copied down.
    =OFFSET($X$2,MATCH($B$2,$W$3:$W$59,0)+LEFT(B7,1)-1,MATCH(C$12,$Y$2:$AT$2,0))

    For D14 you need =OFFSET($X$2,MATCH($B$2,$W$3:$W$59,0)+LEFT(B7,1)-1,MATCH(C$12,$Y$2:$AT$2,0)) because you access a different date.


    I hope this helps, please let me know!

    Regards,

    David

    If this has been helpful
    - Please click on the *Add Reputation button at the bottom left.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

    Attached Files Attached Files
    Last edited by David A Coop; 04-07-2020 at 10:00 PM.

  12. #12
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Can't figure out proper use of Index/Match to solve this problem

    I have now spotted why I am getting a different answer to the INDEX/MATCH ARRAY formulas provided by OP and AliGW!

    Those formulae are picking up the result for 3 - Completed from the week before. Not the target week. Was this intended? I haven't worked out why yet!!!

    Is my solution a suitable alternative, or am I on the wrong bus?

    Regards,

    David

+ 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] Is Index/Match the proper formula for this?
    By recuvajenkins in forum Office 365
    Replies: 7
    Last Post: 12-27-2018, 10:32 AM
  2. INDEX & MATCH Function to solve my problem - can anyone help
    By Ray3213 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2017, 08:10 PM
  3. INDEX MATCH 2 way won't return proper value
    By sheeptape in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2015, 03:44 PM
  4. [SOLVED] Can't figure out proper formulas and functions for textbook problem
    By Burton18 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2014, 02:36 AM
  5. Replies: 8
    Last Post: 07-02-2013, 08:06 PM
  6. Can match or index be used to solve my problem?
    By Celticshadow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2011, 11:38 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