+ Reply to Thread
Results 1 to 4 of 4

Change background colour to yellow if cell doesn't match the previous cell

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    5

    Change background colour to yellow if cell doesn't match the previous cell

    Hi, I have a huge table with products as rows and the month Jan-Dec in the columns. Each cell has a price (number).

    So each cell is the price for a specific product and a specific month. Each cell is automatically populated by the same value as in the previous left cell. So cell B2 is =A2, C5 is =B5 and so on.

    Now the problem is when the prices are changed, it's not very visible in the table, so I wanted to insert a formula that colours the cell yellow when the price is not equal to the month before.

    I can manage this cell by cell with the conitional formatting, making a new rule for a specific cell to turn yellow if not equal to the previous cell, but it will take me months to do it cell by cell. There must be a clever formula of function for this, so I can just apply it on the whole table at once?

    Thanks in advance

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Change background colour to yellow if cell doesn't match the previous cell

    Just select the whole range and use
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It will automatically adjust as you go across and down. Just don't use absolute addresses like $A$2
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-21-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Change background colour to yellow if cell doesn't match the previous cell

    Thank you so much, adding that simple code to the conditional formatting saved me tons of time

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Change background colour to yellow if cell doesn't match the previous cell

    You're welcome. Thanks for the rep.



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


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    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


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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: 6
    Last Post: 04-11-2016, 09:48 AM
  2. Replies: 5
    Last Post: 04-16-2014, 11:52 AM
  3. [SOLVED] Macro to change text colour of adjacent cell to the same text colour as target cell
    By kayoke in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-28-2012, 04:18 AM
  4. How do I change the colour of the cell to yellow when I click the option box ?
    By achill3s in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2012, 09:46 PM
  5. Number change color depend if left cell turn yellow
    By unley in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-01-2011, 02:38 AM
  6. Fill the cell with yellow colour
    By pani_hcu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2009, 04:22 AM
  7. [SOLVED] formula for if Cell c1 is yellow shaded cell d1 should be yellow
    By Hardeep in forum Excel General
    Replies: 1
    Last Post: 10-27-2005, 10:05 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