+ Reply to Thread
Results 1 to 12 of 12

Problem with Index-Match function

  1. #1
    Registered User
    Join Date
    05-18-2017
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    MS Office 2013
    Posts
    15

    Problem with Index-Match function

    Can someone tell me why this function is not working? I obtained the maximum value from a table and wanted to use index-match to return the column header under which the maximum value occurred. But the formula I used ended up returning #N/A. How do I fix this?

    EDIT: Fixed the problem with the attachment.
    Attached Images Attached Images
    Last edited by offload; 05-29-2018 at 12:54 PM.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem with Index-Match function

    Hello and welcome to the forum. Your attachment didn't work.

    To upload an Excel workbook, follow these steps:
    1) Click on "Go Advanced"
    2) Click on "Manage Attachments"
    3) Click on "Choose File"
    4) Choose your file and click on "Open"
    5) Click on "Upload"
    6) Click on "Close this window"

  3. #3
    Registered User
    Join Date
    05-18-2017
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    MS Office 2013
    Posts
    15

    Re: Problem with Index-Match function

    Sorry, I wasn't aware of how to properly attach the file. Since I was using an image, I thought insert image would work.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem with Index-Match function

    Try this:

    =INDEX(1:1,MAX(IF(B2:E11=K7,COLUMN(B2:E11)))) Ctrl Shift Enter

  5. #5
    Registered User
    Join Date
    05-18-2017
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    MS Office 2013
    Posts
    15

    Re: Problem with Index-Match function

    Thank you! That did the job. If there were two cells with the same maximum value, how do I modify this formula to return the column header of the second of those two values?

    And if I wanted to return the row along which the maximum value occurred, how do I modify the formula?
    Last edited by offload; 05-29-2018 at 12:54 PM.

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem with Index-Match function

    Whoops, the formula in post #4 should have used B2:G11 and not B2:E11.

    If there were two cells with the same maximum value, how do I modify this formula to return the column header of the second of those two values?
    The formula already does this. It pulls the right-most column that has the max number in it.

    And if I wanted to return the row along which the maximum value occurred, how do I modify the formula?
    Assuming that you want to return the Day # from column A, not the actual row #, try this:

    =INDEX(A:A,MAX(IF(B2:G11=K6,ROW(B2:G11)))) Ctrl Shift Enter

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem with Index-Match function

    Note that the formula (that returns the Day #) from post #6 will return the Day # of the furthest down row that has the max number in it.

  8. #8
    Registered User
    Join Date
    05-18-2017
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    MS Office 2013
    Posts
    15

    Re: Problem with Index-Match function

    Quote Originally Posted by 63falcondude View Post

    The formula already does this. It pulls the right-most column that has the max number in it.

    Right, didn't notice that. What I meant was if I have multiple rows/columns that contain the maximum value, how do I choose to return the column/row heading for the first, second or third instance of that value?

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem with Index-Match function

    I have a feeling that the requirements are going to continue to change until I can no longer help but I'll hang in there for now.

    Column Heading:
    First Match =IFERROR(INDEX(1:1,SMALL(IF(B2:G11=K7,COLUMN(B2:G11)),1)),"") Ctrl Shift Enter
    Second Match =IFERROR(INDEX(1:1,SMALL(IF(B2:G11=K7,COLUMN(B2:G11)),2)),"") Ctrl Shift Enter
    Third Match =IFERROR(INDEX(1:1,SMALL(IF(B2:G11=K7,COLUMN(B2:G11)),3)),"") Ctrl Shift Enter

    This goes from left to right.

    Row Heading (Day #):
    First Match =IFERROR(INDEX(A:A,SMALL(IF(B2:G11=K7,ROW(B2:G11)),1)),"") Ctrl Shift Enter
    Second Match =IFERROR(INDEX(A:A,SMALL(IF(B2:G11=K7,ROW(B2:G11)),2)),"") Ctrl Shift Enter
    Third Match =IFERROR(INDEX(A:A,SMALL(IF(B2:G11=K7,ROW(B2:G11)),3)),"") Ctrl Shift Enter

    This goes from top to bottom.

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem with Index-Match function

    If the Day #'s are supposed to be correlated with the column headers, you can use this for the Day #:

    N8 =INDEX($A:$A,MAX(IF(($B1:$G1=N7)*($B2:$G11=$K7),ROW($B2:$G11)))) Ctrl Shift Enter
    Drag to the right.

    See attachment.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-18-2017
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    MS Office 2013
    Posts
    15

    Re: Problem with Index-Match function

    Quote Originally Posted by 63falcondude View Post
    I have a feeling that the requirements are going to continue to change until I can no longer help but I'll hang in there for now.
    Haha that's all the requirements (for now). Your help has been invaluable. I am just getting to grips with Excel so here is a lot I don't know yet.

  12. #12
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem with Index-Match function

    You're welcome. Happy to help.

+ 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. 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
  2. [SOLVED] Problem with variable types in an index/match function
    By izzorac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2014, 02:18 PM
  3. [SOLVED] Nested IF Function problem, involving index/match
    By nonymous in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2014, 12:03 PM
  4. Problem of using INDEX/MATCH function with duplicated values
    By offshore-safety in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2010, 05:45 AM
  5. Regarding Index & Match function problem
    By ramki in forum Excel General
    Replies: 4
    Last Post: 08-20-2008, 06:15 PM
  6. Index & Match function problem
    By ramki in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2008, 08:13 AM
  7. Index - Match Function -- Problem
    By kmsubbu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-15-2008, 07:23 PM

Tags for this Thread

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