+ Reply to Thread
Results 1 to 13 of 13

Conditional formatting with INDEX MATCH MATCH

  1. #1
    Registered User
    Join Date
    04-27-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    5

    Conditional formatting with INDEX MATCH MATCH

    Hi, hoping someone can help me with what seems like a fairly complex formula.

    I am trying to check whether given values are 'allowed' according to a list of predefined values, using conditional formatting.

    My first issue was to check whether items in one column appear in another column. This was fairly straightforward and I used:
    =ISERROR(MATCH(G2,$J$2:$J$5,0))
    where G2 is the value to check, and J2:J5 is the list of predefined values. This is working fine.

    Now what I want to do, is check value H2 in a multi-column/row table. The row it should check in can be found with value G2, but it could appear in any column of the table.

    So far, I've got:
    =ISERROR(INDEX(K2:U5,MATCH(G2,J2:J5,0),MATCH(H2,K2:U5,0)))

    Where K2:U5 is the table that H2 could appear in
    J2:J5 is the column that G2 could appear in. But this just gives me an error.

    In plan English I want it to look at value G2, find out what row that's in in column J (say row x), and then look to see whether value H2 appears in any of the columns of row x in the specified table.
    The image below shows where it should be highlighted

    Capture.PNG

    Very confused, really hope someone can help me!

    Thanks,
    Jess

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional formatting with INDEX MATCH MATCH

    How about this for conditional formatting formula in H2 and down?
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached.

    BSB
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Conditional formatting with INDEX MATCH MATCH

    I think it should be

    =SUMPRODUCT(($J$2:$J$5=G6)*($K$2:$U$5=H6)) (TRUE)

    ??

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional formatting with INDEX MATCH MATCH

    Quote Originally Posted by JohnTopley View Post
    I think it should be

    =SUMPRODUCT(($J$2:$J$5=G6)*($K$2:$U$5=H6)) (TRUE)

    ??
    Surely that would highlight the valid selections in column H. The image in post#1 shows the invalid ones to be highlighted.

    BSB

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Conditional formatting with INDEX MATCH MATCH

    I cannot see the image so ASSUMED from description ...

    and then look to see whether value H2 appears in any of the columns of row x in the specified table.
    ... that match is highlighted. Bot of course if reverse is true, your formula is correct.

    My apologies!!

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional formatting with INDEX MATCH MATCH

    Quote Originally Posted by JohnTopley View Post
    I cannot see the image so ASSUMED from description ...
    PHEW!
    Had me doubting myself for a moment there, Mr Topley!

    BSB

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Conditional formatting with INDEX MATCH MATCH

    Select H2:H20 and use below formula in conditional format
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  8. #8
    Registered User
    Join Date
    04-27-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    5

    Re: Conditional formatting with INDEX MATCH MATCH

    Hi,
    Thanks for all your suggestions so far.
    I think unfortunately none of them are working, because they're not taking into account that a pack size might be incorrect for one product, but correct for another.

    BSB, I can see that your formula works in the downloaded document, but for some reason it's having no effect in my version...

  9. #9
    Registered User
    Join Date
    04-27-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    5

    Re: Conditional formatting with INDEX MATCH MATCH

    My error - it actually works completely perfectly and is so much simpler than the way I was trying to do it!
    Thank you so much for your help

  10. #10
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional formatting with INDEX MATCH MATCH

    Happy to help.
    Thanks for the rep point

    BSB

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Conditional formatting with INDEX MATCH MATCH

    Your INDEX/MATCH/MATCH formula has a problem too....

    =ISERROR(INDEX(K2:U5,MATCH(G2,J2:J5,0),MATCH(H2,K2:U5,0)))

    MATCH only allows for a single column or row, you have an array in the 2nd MATCH....
    =ISERROR(INDEX(K2:U5,MATCH(G2,J2:J5,0),MATCH(H2,K2:U2,0)))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  12. #12
    Registered User
    Join Date
    04-27-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    5

    Re: Conditional formatting with INDEX MATCH MATCH

    Hi again BSB,

    You wouldn't be able to tell me how to convert my original formula to work more like yours would you? I think yours is better and it also seems more flexible!
    So something like =SUMPRODUCT($J$2:$J$5=G2)=0 (which doesn't work) to indicate instances where G2 cannot be found in J2:J5.

    I've been reading about SUMPRODUCT to try and do this myself, and whilst I think I understand the principles (it applies a 1/0 - TRUE/FALSE value to each instance), I can't understand how it could be used with just one array!

    Thanks,
    Jess

  13. #13
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional formatting with INDEX MATCH MATCH

    Try

    =SUMPRODUCT(--($J$2:$J$5=G2))=0

    Then read into SUMPRODUCT with a double unary "--" to understand it.

    Or use your formula with *1 at the end.

    Note: Not tested as I'm replying from my phone so don't have Excel open.

    BSB

+ 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] Index Match and Conditional Formatting
    By leebird in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-16-2016, 10:36 PM
  2. Conditional formatting a cells to match an index
    By cwhite86 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-24-2015, 10:25 AM
  3. [SOLVED] Error using INDEX MATCH in Conditional Formatting
    By Jack_is_Back in forum Excel General
    Replies: 7
    Last Post: 04-15-2014, 03:56 PM
  4. [SOLVED] conditional formatting with MATCH/INDEX formula (in VBA)
    By macrorookie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2014, 07:16 AM
  5. Conditional formatting using Index/Match
    By sj123 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-14-2014, 03:19 PM
  6. Conditional Formatting with INDEX/MATCH
    By Shanster695 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-22-2013, 02:39 PM
  7. Conditional Formatting with Index/Match function
    By zhopa19 in forum Excel General
    Replies: 5
    Last Post: 10-04-2011, 04:57 AM

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