+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting - value not equal to first row values

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    ottawa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Conditional formatting - value not equal to first row values

    Hello - I've been working on this by myself all morning but I know there's an easier way. Hoping you can help!

    I have a spreadsheet of multiple choice responses for an exam. The first row is the correct answer for each question (i.e. instructor's sheet), and each row has the corresponding responses for a student. I would like to highlight the cells where a student's answer does not match the instructor's answer. I have been able to do this for a single column (so that all the incorrect answers for that question turn red) using conditional formatting.

    Is there any way to do this for the worksheet without doing it column by column? I have been using the drop down menu (conditional formatting) because I'm a complete noob on excel. Basically I just want any values in the worksheet to be red if they don't match the values in that column's first row.

    Any help you can provide would be very appreciated!!!!!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional formatting - value not equal to first row values

    Can you post a SMALL sample file so we can see the layout?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional formatting - value not equal to first row values

    Select A1
    Select all cells (ctrl+A twice)
    Create a new rule in conditional formatting.
    You want the rule to be based on a formula.
    Use this formula:
    =A1<>A$1

    Note the dollar sign

    The A1 part will refer to each cell (as in for A1 it refers to A1, for C2 it refers to C2)
    The A$1 part will refer to the column dynamically (as above) but the row will always be 1

    So you have an equation which equates:
    This cell <> the cell on row 1 of the same column

    this evaluates to FALSE for correct answers, and TRUE for incorrect answers, so this will highlight incorrect answers. The equivalent formula for correct answers is
    =A1=A$1

    HTH
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  4. #4
    Registered User
    Join Date
    03-11-2013
    Location
    ottawa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Conditional formatting - value not equal to first row values

    Thanks so much for helping...I tried the formula you gave me, Cheeky Charlie, but it didn't work. Some columns highlighted everything regardless of the number in the first row for that column and the others were wrong as well. Thanks for explaining the placement of the $ symbol - I had read about it but understood that it would depend on the value of the preceding cell (and not in reference to the first cell in the first row for each column).

    I'm going to try and attach an image of a screenshot. Hopefully it's not huge. The first row is the teacher's answer key (with each column representing a different question). Each subsequent row is a student's answer for the questions. Note that the first few columns have a discrepant answer in red. I did this using the conditional formatting function, but I created a separate rule for each column. I'd like to be able to do it for the whole spreadsheet if possible (basically highlighting/isolating all the incorrect answers so students can see at a glance which ones were wrong).

    excel.jpg

    Any ideas? If the picture works I'll do the formula above again and post the end result.

  5. #5
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional formatting - value not equal to first row values

    Hi Stisso,

    Normally those dollar signs affect how a formula behaves when its copied. They have a similar effect in conditional formatting, but related to which cells are referenced for calculation of the conditional format formula (are the cells referred to fixed or are the different depending on which cell the condition is being calculated for?). I've realised in writing this that it's actually quite hard to explain!

    As a general rule, actual file uploads are a LOT more helpful than pictures. On this occasion, I have a feeling about what might have gone wrong, I think your conditional formats may be referencing the wrong cells:

    Please go through these steps:
    Select columns E:AR
    Cell E1 should be highlighted white whilst the rest of the selection is pale blue/grey.

    This bit is as above:
    Create a new rule in conditional formatting.
    You want the rule to be based on a formula.
    Use this formula:
    =E1<>E$1

+ 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