+ Reply to Thread
Results 1 to 14 of 14

conditional formatting with multiple rows

  1. #1
    Registered User
    Join Date
    03-01-2011
    Location
    Perth,Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Question conditional formatting with multiple rows

    I have a spreadsheet with which users register the results of random breathalyzer tests.
    I have it set up so that if the result is ever FAIL, the text goes red
    In column B is the name of the person tested, column D is the pass/fail.
    how would I go about highlighting the cell if a person has failed twice or more?
    can conditional formatting do this? or will I need a macro?
    Last edited by tutigan; 03-02-2011 at 01:35 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: conditional formatting with multiple rows

    Hi and welcome to the board,

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    03-01-2011
    Location
    Perth,Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: conditional formatting with multiple rows

    hi arthurbr thank you for welcome and advice

    I have attached a dummy workbook with how it is at the moment, with only the highlighting of text, if the text reads "FAIL"

    if any clarification is needed, or anyone has questions, or cannot understand my English, please feel free to ask!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-27-2006
    MS-Off Ver
    MS Office 2007
    Posts
    79

    Re: conditional formatting with multiple rows

    Hi,

    I hthink this is what you want.

    For Conditional Formatting, I selected the whole column and formatted it to Font Color = Red when Cell value = FAIL

    I created a formula in "Comments" column to show "More Than Once" if the person's name as appeared before.

    Hope this helps.
    Attached Files Attached Files
    TL

    https://sites.google.com/site/teelim/
    My page of "not so useful" spreadsheets

  5. #5
    Registered User
    Join Date
    03-01-2011
    Location
    Perth,Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: conditional formatting with multiple rows

    Quote Originally Posted by teelim View Post
    Hi,

    I hthink this is what you want.

    For Conditional Formatting, I selected the whole column and formatted it to Font Color = Red when Cell value = FAIL

    I created a formula in "Comments" column to show "More Than Once" if the person's name as appeared before.

    Hope this helps.
    Hi teelim, sorry for confusion, let me clarify.
    some people are on-site many times, so will appear many times in the list, but not always as a fail (I hope!) so I want the colour to change (or the comment to appear - good thinking with that!) if that person has more than one fail against their name
    so for instance, if "mr person" appears seven times in the list, each time with a PASS, then nothing happens, but if "someone else" appears four times, and two of them are FAIL, then have the FAIL cell background change colour to red (and black text)

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: conditional formatting with multiple rows

    It is not clear to me what you want highlighted if a person fails more than once. I assumed it is the name.

    See attached, and don't hesitate to come back if you need more info
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-01-2011
    Location
    Perth,Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: conditional formatting with multiple rows

    sorry, I think this makes more sense...

    in attached, "mr man" has failed more than once, so the 'fail' cell has been highlighted.
    I want to be able to have that happen automatically - so if a person fails once, the text 'FAIL' turns red, if they fail again (>1) then the text 'FAIL' stays red, but the cell is highlighted (like in attached)

    I hope that makes more sense!
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: conditional formatting with multiple rows

    To keep things simple I added a helper column to count the nr of occurrences of FAIL for a person, then used the column to implement the CF
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-01-2011
    Location
    Perth,Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: conditional formatting with multiple rows

    thank you so much arthurbr!

  10. #10
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: conditional formatting with multiple rows

    My pleasure

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  11. #11
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: conditional formatting with multiple rows

    My pleasure

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  12. #12
    Registered User
    Join Date
    03-01-2011
    Location
    Perth,Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: conditional formatting with multiple rows

    hi arthurbr,

    I've just tried using that but found one small problem... the formula you used is for a set range of cells, but I need it for the entire column... I changed it from:
    =SUMPRODUCT(($B$3:$B$10=B3)*($D$3:$D$10="fail"))
    to:
    =SUMPRODUCT(($B:$B=B3)*($D$3:$D$10="fail"))
    but now the cell text says #NUM!
    I tried changing it instead to:
    =SUMPRODUCT(($B$3:$B$99=B4)*($D$3:$D$10="fail"))
    and now get #N/A! as the cell text
    I presume this is because those cells are empty... is there anyway around this?

  13. #13
    Registered User
    Join Date
    03-01-2011
    Location
    Perth,Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: conditional formatting with multiple rows

    sorry, I've realised my mistake... I forgot to change the values for the D column!
    =SUMPRODUCT(($B$3:$B$999=B4)*($D$3:$D$999="fail"))

  14. #14
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: conditional formatting with multiple rows

    Glad you found a solution. SUMPRODUCT in versions prior to 2007 do not accept entire columns like $B:$B, and the ranges should have the same length, as you found out.
    Extensive info on this function at http://www.xldynamic.com/source/xld....T.html#classic

+ 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