+ Reply to Thread
Results 1 to 10 of 10

Index Match with Large and If Formula - Not Working

  1. #1
    Registered User
    Join Date
    05-07-2014
    Location
    Guildford
    MS-Off Ver
    Excel 2003
    Posts
    6

    Index Match with Large and If Formula - Not Working

    Hi,

    I have a large data table of sporting events that I am trying to extract details of the top 10 events based on number of viewers.

    Here is a simplified version of the formula I have tried. For the purposes of the below, I am trying to deliver the value in column A (event name) that corresponds to the largest value in column D (number of viewers) that satisfies the two if statements, B (sport) and C (date).

    {=INDEX(A10:A20,MATCH(LARGE(IF(B10:B20=$A$1,IF(C10:C20=$B$,(D10:D20))),1),D10:D20,0))}

    {=INDEX(A10:A20,MATCH(LARGE(IF(B10:B20=$A$1,IF(C10:C20=$B$,(D10:D20))),2),D10:D20,0))}

    {=INDEX(A10:A20,MATCH(LARGE(IF(B10:B20=$A$1,IF(C10:C20=$B$,(D10:D20))),3),D10:D20,0))}

    etc.

    The values that are returned seem to only satisfy one of the criteria, i.e. either the sport or the data. For example, when A1=Tennis, it is still returning Football events.

    Can anyone shed any light on where I am going wrong with this?

    Thanks in advance

  2. #2
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Index Match with Large and If Formula - Not Working

    Hi,
    Welcome to the forum.

    In the below formulas, what does the $B$ (highlighted in blue) correspond to ? Check on that.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Can u post a sample workbook?
    Last edited by Saarang84; 05-07-2014 at 06:45 AM.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  3. #3
    Registered User
    Join Date
    05-07-2014
    Location
    Guildford
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Index Match with Large and If Formula - Not Working

    Thanks for the welcome.

    Oh yes that was a typo - it is supposed to read $B$1 and B1 is a cell where a date can be inputted.

    The formulas I have written above are simplifications of the actual spreadsheet I am working off as there are more like 100,000 lines of data in the table and the table is in a separate spreadsheet to where I am trying to create the top 10 list.

    The formulas above seem to work okay (i'm not sure how to attach a sample workbook?), but for some reason, the same framework doesn't work correctly when I implement it on my spreadsheet, and it pulls event names out with the wrong sports or the wrong date.

    For reference, here is the exact formula I am working with:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    etc.

    Thanks

  4. #4
    Registered User
    Join Date
    05-07-2014
    Location
    Guildford
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Index Match with Large and If Formula - Not Working

    Example_Sheet.xlsx

    Example spreadsheet attached - this seems to work correctly

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Index Match with Large and If Formula - Not Working

    Hi Connor,

    Welcome to the forum. Your formulas in the sample workbook seem to work correctly for the sport and the date mentioned in cells $A$1 and $B$1 respectively.
    You may need to freeze the ranges A10:A20, B10:B20 and C10:C20 as $A$10:$A$20, $B$10:$B$20, $C$10:$C$20 and $D$10:$D$20.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Confirm these formulas as array formula by pressing Ctrl + Shift + Enter.

  6. #6
    Registered User
    Join Date
    05-07-2014
    Location
    Guildford
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Index Match with Large and If Formula - Not Working

    Hi,

    I have tried the above and as you say, it works fine in the sample workbook but not when I apply it to my data table (the formula I have provided 3 posts up)

    Thanks

  7. #7
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Index Match with Large and If Formula - Not Working

    Which formula are you referring to in post #3, the first or second one?

  8. #8
    Registered User
    Join Date
    05-07-2014
    Location
    Guildford
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Index Match with Large and If Formula - Not Working

    Quote Originally Posted by richoconnor View Post

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The formula above is what I am working from, and is the one that isn't working correctly. It is displaying values from column O that don't satisfy both $C$2:$C$99999=$J$2 and $J$2:$J$99999=$B$5

    The formula I posted in my first post was a simplification of this and seems to work fine in the spreadsheet that I attached.

    Thanks

  9. #9
    Registered User
    Join Date
    05-07-2014
    Location
    Guildford
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Index Match with Large and If Formula - Not Working

    Just to let you know I've figured this one out:

    I used this formula to pull through the viewing data in order:

    {=IFERROR(INDEX('[March 2014 Reports.xlsx]Report 5'!$R$2:$R$99999,MATCH(LARGE(IF('[March 2014 Reports.xlsx]Report 5'!$C$2:$C$99999=$J$2,IF('[March 2014 Reports.xlsx]Report 5'!$J$2:$J$99999=$B$5,('[March 2014 Reports.xlsx]Report 5'!$R$2:$R$99999))),1),'[March 2014 Reports.xlsx]Report 5'!$R$2:$R$99999,0)),"-")}

    and then used another index match with if statements to pull through the event name:

    {=INDEX('[March 2014 Reports.xlsx]Report 5'!$O$2:$O$99999,MATCH($E7,IF('[March 2014 Reports.xlsx]Report 5'!$J$2:$J$99999=$B$5,IF('[March 2014 Reports.xlsx]Report 5'!$C$2:$C$99999=$J$2,'[March 2014 Reports.xlsx]Report 5'!$R$2:$R$99999)),0))}

    Turns out as there are multiple events with the same viewing data number, it was just pulling through the first event regardless of the criteria.

    Thanks

  10. #10
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Index Match with Large and If Formula - Not Working

    Have you identified the issue?
    It would really be easy to identify the issue if you post the structure of real workbook with some mocked up data (if the data is sensitive)

+ 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. VLOOKUP or INDEX/MATCH Formula that uses LARGE, IF, and OR
    By tj2434 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-24-2014, 10:16 AM
  2. 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
  3. [SOLVED] Index/Match using Large Formula
    By Steve0492 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2013, 04:08 AM
  4. [SOLVED] Long array formula with INDEX and MATCH quits working when range is too large
    By UncleKevy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-05-2013, 09:42 PM
  5. [SOLVED] using Index, Match, Large, and Visible Cells in one formula
    By jomili in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-10-2013, 01:58 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