+ Reply to Thread
Results 1 to 14 of 14

Conditional Format For Lowest When There Are Blanks

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 7 & 10
    Posts
    11

    Conditional Format For Lowest When There Are Blanks

    I have s sheet that lists 28 rows of 10 scores across where the data in the columns are added each week. From the 8th week to the 10th week, I want to highlight the lowest score as follows:

    Eighth Week- one lowest score; Ninth Week- two lowest scores; Tenth Week- three lowest scores.

    I am having problems making the correct Conditional Formatting code.

    Suggestions would be greatly appreciated.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Conditional Format For Lowest When There Are Blanks

    hi Bobby1949, assuming the Week1 starts from A1, you can select H2:H29 & go to Home -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format-> Format values where this formula is true:
    =SMALL($H$2:$H$29,1)=$H2

    Do similar formulas for Week 9 & Week 10, changing the column alphabet & the Nth number. Hence, Week 9 is selecting I2:I29:
    =SMALL($I$2:$I$29,2)>=$I2

    attached a worksheet for your reference
    Attached Files Attached Files

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Format For Lowest When There Are Blanks

    Select 8th week row,

    go to Home|Conditional Formatting|New Rule

    select use formula to determine which cells to format

    enter formula:

    =AND(A8<>"",A8<=SMALL($8:$8,2))

    click format and choose colour.

    where it is assumed row 8 is Eigth week. Do same for 9 and 10, changing the SMALL(...,2) to 3 and 4, respectively.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    03-01-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 7 & 10
    Posts
    11

    Re: Conditional Format For Lowest When There Are Blanks

    Thank you both for your suggestions. However, I may have not explained my goal properly. The sheet looks similar to benishiryo's attachment. The goal is to highlight the three lowest scores for the entire ten weeks. The low score would include all scores from week one to week ten. I am very sorry for the incorrect explanation.

    Thanks

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Format For Lowest When There Are Blanks

    Using benishiryo's attachment there are 5 instances of 1 (being the lowest score).. do you want those to be what is highlighted?

  6. #6
    Registered User
    Join Date
    03-01-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 7 & 10
    Posts
    11

    Re: Conditional Format For Lowest When There Are Blanks

    Quote Originally Posted by NBVC View Post
    Using benishiryo's attachment there are 5 instances of 1 (being the lowest score).. do you want those to be what is highlighted?
    When there are eight scores (week 1 thru 8) weeks I need to highlight the one lowest score. When there are nine scores (1 thru 9 weeks) I need the two lowest scores. And when there are all ten scores posted (1 thru 10 weeks) I need the three lowest scores highlighted. To make it a little more confusing is that sometimes there are no scores posted for a particular week for a particular name. So if there is one blank when we get to the 8th week, I don't need a score highlighted.

    The premise is that we only use the seven highest scores out of a possible ten. I want to highlight the three lowest scores to indicate that they are not being used. But, there will be some names that won't have but seven scores out of the ten weeks if they were absent three weeks and have no scores posted. In that case there would be no low score to indicate because all seven would be used. In other words, a name needs a minimum of seven scores, and if they have more, we throw the lowest out...up to a possible three being thrown out.

    Perhaps I should just do it individually without a conditional format code. It does take much time though.

    Thanks

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Format For Lowest When There Are Blanks

    I am not sure if I follow.

    What I did on the attachment is select A2:J29 and apply conditional formula:

    =A2<=SMALL($A$2:$J$29,IF(LOOKUP(REPT("z",255),$A$1:$J$1)="Week8",1,IF(LOOKUP(REPT("z",255),$A$1:$J$1)="Week9",2,3)))

    and it will highlight lowest score based on last week number listed in A1:J1....

    In this case it always highlights all the 1's since there are more than 3 total and so 1 is smallest, second smallest and third smallest scores of all scores...

  8. #8
    Registered User
    Join Date
    03-01-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 7 & 10
    Posts
    11

    Re: Conditional Format For Lowest When There Are Blanks

    Attached is what I want to accomplish. Each name only qualifies if he has a minimum of seven scores, AND only the highest seven out of the ten count. I want to show the low score(s) that will not be used by highlighting. As the weeks progress, some names may have filled all the scores, while others may not. We can't count a blank week as a score.
    Attached Files Attached Files

  9. #9
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Conditional Format For Lowest When There Are Blanks

    ok try highlighting B2:K29 & use this formula in the Conditional Formatting:
    =AND(IF($L2=8,SMALL($B2:$K2,1)>=B2,IF($L2=9,SMALL($B2:$K2,2)>=B2,IF($L2=10,SMALL($B2:$K2,3)>=B2))),B2<>"")

  10. #10
    Registered User
    Join Date
    03-01-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 7 & 10
    Posts
    11

    Re: Conditional Format For Lowest When There Are Blanks

    Quote Originally Posted by benishiryo View Post
    ok try highlighting B2:K29 & use this formula in the Conditional Formatting:
    =AND(IF($L2=8,SMALL($B2:$K2,1)>=B2,IF($L2=9,SMALL($B2:$K2,2)>=B2,IF($L2=10,SMALL($B2:$K2,3)>=B2))),B2<>"")
    There may be an error in the code because it isn't accepted.

  11. #11
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Conditional Format For Lowest When There Are Blanks

    must have accidentally typed a space
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    03-01-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 7 & 10
    Posts
    11

    Re: Conditional Format For Lowest When There Are Blanks

    Quote Originally Posted by benishiryo View Post
    must have accidentally typed a space
    Please Login or Register  to view this content.
    Fantastic!!! I am going to study this one to break down the elements. Great job. It does exactly what I was after.

    Thanks so much.

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Format For Lowest When There Are Blanks

    Alternatively:

    =AND(SMALL($B2:$K2,CHOOSE($L2-7,1,2,3))>=B2,B2<>"")

  14. #14
    Registered User
    Join Date
    03-01-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 7 & 10
    Posts
    11

    Re: Conditional Format For Lowest When There Are Blanks

    Quote Originally Posted by NBVC View Post
    Alternatively:

    =AND(SMALL($B2:$K2,CHOOSE($L2-7,1,2,3))>=B2,B2<>"")
    This works great too. In fact, whenever we can get the required results using fewer keystrokes, makes us happier. I never would have thought of using the CHOOSE function. Very efficient.

    Thanks for your help.

+ 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