+ Reply to Thread
Results 1 to 14 of 14

Explain Index Match formula

  1. #1
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Explain Index Match formula

    Can anyone explain in words what this formula is doing?

    =IFERROR(INDEX([RefHidden_120112.xlsm]Ref!$CA$5:$CB$22,
    MATCH(1,IF(TODAY()>=[RefHidden_120112.xlsm]Ref!$BY$5:$BY$22,
    IF(TODAY()<=[RefHidden_120112.xlsm]Ref!$BZ$5:$BZ$22,1)),0),
    MATCH(B92,[RefHidden_120112.xlsm]Ref!$CA$3:$CB$3,0)),1)

    Thanks.

    Dan

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Explain Index Match formula

    You have a table in Ref!$CA$5:$CB$22. The formula extracts a single value from that table, the row is determined by the first row in the table where today's date is between the dates shown in columns BY and BZ and the column is determined by matching B92 against the column headers in Ref!$CA$3:$CB$3, so if the date matches in row 8 and B92 matches Ref!CB3 then you get the value at the intersection of those, i.e. the value from CB8.

    If there is no match for either column or row (or both) the IFERROR part kicks in and the formula returns 1

    This is an array formula that needs to be confirmed with CTRL+SHIFT+ENTER

    If you want I can give you more detail on the specific mechanics of each function......
    Audere est facere

  3. #3
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Explain Index Match formula

    Thanks for the explanation daddylonglegs, that's very helpful. If you have time to give more detail on the specific mechanics of each function, that would be much appreciated. Thanks.

    Dan

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: Explain Index Match formula

    Use Help for each function.. It's explained there with examples...
    Rather than we coppy paste it here

  5. #5
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Explain Index Match formula

    Ok, thanks zbor

  6. #6
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Explain Index Match formula

    INDEX([RefHidden_120112.xlsm]Ref!$CA$5:$CB$22 sets the table of your data. This is the whole table that will contain the item to lookup and the value to return

    IF(TODAY()>=[RefHidden_120112.xlsm]Ref!$BY$5:$BY$22,
    IF(TODAY()<=[RefHidden_120112.xlsm]Ref!$BZ$5:$BZ$22,1)),0),
    MATCH(B92,[RefHidden_120112.xlsm]Ref!$CA$3:$CB$3,0))tells it what row to the value you want is in. It's looking for where today's date is greater than or equal to a date in the specific area of BY5:BY22 AND in BZ5:BZ22, AND then returning the row number where CA3:CB3 matches what's in B92.

    1) tells the index function once it has the row number, to return the data in column 1 of that row, in this case column CA.

  7. #7
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Explain Index Match formula

    Thanks for a very useful breakdown - makes things a lot clearer.

    Dan

  8. #8
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Explain Index Match formula

    I end up building them that way as well. I have to do it step by step still, starting with the match. If matching two criteria, I get one working, then the second, then wrap them together, then stick that in the Index, and if that goes well, then I wrap it in If(IsError(

    It can be pretty confusing stuff, but I'm become extremely comfortable with it after only a week. Persistence is the key


    EDIT: In re-reading, daddylonglegs is spot on. My mistake! I'm used to wrapping these in the If(IsError to return "" if there is no value to return. He's absolutely correct about the intersection value for the column, and the 1 is simply returned for when the values do not line up. Apologies!
    Last edited by soberguy; 06-21-2012 at 04:10 AM.

  9. #9
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Explain Index Match formula

    Yes, the only way I can build a more complicated formula is by creating each step and then latching them together. I'm not sure of the best process to build formulas as probably not spent enough time going through excel tutorials. I use Notepad++ and put each arguement on each row. I know that it is not very efficient because I often end up covering the same condition in another arguement on other rows. Example:

    =IF(AND(L216="W",C216="IB"),(I216*G216),
    IF(AND(L216="W",C216="CB"),(I216*G216),
    IF(AND(L216="W",C216="FB-SR"),(I216*G216),
    IF(AND(L216="W",C216="FB-SR"),(I216*G216-I216),
    IF(AND(L216="V",C216="IB"),I216,
    IF(AND(L216="V",C216="CB"),I216,
    0))))))

    I am sure this could written more efficiently, but its the only way I know how to write it.

    You have become comfortable with Excel after only a week? Or MATCH and INDEX after only a week?

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: Explain Index Match formula

    Why you have different result on same inputs:

    IF(AND(L216="W",C216="FB-SR"),(I216*G216),
    IF(AND(L216="W",C216="FB-SR"),(I216*G216-I216),

  11. #11
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: Explain Index Match formula

    Assuming that second is IF(AND(L216="V",C216="FB-SR"),(I216*G216-I216),

    then you can shorten it as:

    =I216*IF(L216="W", G216, IF(C216="FB-SR", G216-1, 1))

    Basically, creating table and using INDEX/MATCH approach would be easier than lot of IF's.

  12. #12
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Explain Index Match formula

    Thanks zbor much appreciated. Another formula on the same sheet I want to adapt is:

    =IF(OR(Q118={"$","€"}),VLOOKUP(E118,[RefHidden_120112.xlsm]Ref!$BY$5:$CB$60,MATCH(Q118,[RefHidden_120112.xlsm]Ref!$BY$3:$CB$3,0)),"1.00")

    I want it to return "--" IF Q118="". I am not sure of the syntax to add the extra IF.

  13. #13
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: Explain Index Match formula

    Can you open new thread for this since this going off topic now?

  14. #14
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Explain Index Match formula

    yes, sorry.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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