+ Reply to Thread
Results 1 to 9 of 9

Conditional formatting few cells when the records meet certain number requirements/range.

  1. #1
    Registered User
    Join Date
    04-12-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    7

    Conditional formatting few cells when the records meet certain number requirements/range.

    HI friends

    I have a situation and need your help please.

    Lets say i am allowing students to choose 3 subjects.
    However, each student is given only up to 3 choices of subjects to choose from a long list of subjects.

    Each subject would have its min score requirements based on gender.

    Hence, if i were to extract an excell sheet of the list of all the students and their respective subject choices 1, 2, 3,
    how then do i get excell to highlight their choices which meets the min. score requirements based on gender?

    I have uploaded the excell sheet sample with the necessary data and records attached. Appreciate your help please.
    The table on the left with yellow highligted cells is what i would like to achieve.
    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,898

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    Can be done without VBA.

    Your manually entered results are not quite correct, however:

    1. Select cell D2.
    2. Create a conditional formatting formula rule using this formula:

    $B2>=INDEX($I$3:$J$15,MATCH(D2,$H$3:$H$15,0),MATCH($C2,$I$2:$J$2,0))

    3. Set the formatting required.
    4. In the Applies To box, type:

    =$D$2:$F$6

    All done.
    Attached Files Attached Files
    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
    Registered User
    Join Date
    04-12-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    7

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    Hi AliGw. Thank you for your quick reply. I couldn't open your attachment. I followed your instructions. The formula could still be found in the conditional formatting rules manager. however, my cells do not automatically turn to the desired colour

  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,898

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    There is nothing wrong with the attachment - it opens fine. If you are having problems implementing the CF rule, then attach YOUR file here for me to have a look at.

  5. #5
    Registered User
    Join Date
    04-12-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    7

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    Here it is. Let me know whats wrong. Thanks.
    Attached Files Attached Files

  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,898

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    You have speech marks at either end of the formula:

    ="$B2>=INDEX($I$3:$J$15,MATCH(D2,$H$3:$H$15,0),MATCH($C2,$I$2:$J$2,0))"

    They should not be there - get rid of them.

  7. #7
    Registered User
    Join Date
    04-12-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    7

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    it works now. Appreciate your time and patience. I dont know why that speech marks appeared anyway.
    Would you be able to explain the logic of the formula in simple terms. I'm trying to graps...why = B2, why index, why match, why ,0.....etc.)
    Last edited by stamina; 04-13-2018 at 12:26 PM.

  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,898

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    OK. Here we go:

    =$B2>=

    1. Check if B2 is bigger than or equal to ...

    INDEX($I$3:$J$15,

    2. ... the value found in the range I3:J5 ...

    MATCH(D2,$H$3:$H$15,0),

    3. ... that matches the intersection in the lookup table of the contents of D2 (found in column H of the lookup table) ...

    MATCH($C2,$I$2:$J$2,0))

    4. ... and the contents of C2 (found in I2:J2 of the lookup table.

    Basically it's a lookup.

  9. #9
    Registered User
    Join Date
    04-12-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    7

    Re: Conditional formatting few cells when the records meet certain number requirements/ran

    Thanks. And why there is a $ sign in C2 and not D2? Whats the significant of the '0'?

+ 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. Replies: 2
    Last Post: 09-21-2016, 11:51 AM
  2. Apply conditional formatting to cells that meet certain criteria
    By dloper in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2014, 09:00 PM
  3. [SOLVED] Conditional Formatting: IF two cells both meet a certain criteria
    By nenadmail in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2014, 08:24 AM
  4. [SOLVED] Conditional Formatting leaving cell blank if doesn't meet requirements
    By Rhiannon25 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-11-2013, 11:55 PM
  5. Replies: 5
    Last Post: 05-18-2013, 07:49 PM
  6. [SOLVED] Count number of cells that meet conditional format
    By alexwm in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-06-2012, 03:54 PM
  7. Replies: 1
    Last Post: 10-02-2008, 03:50 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