+ Reply to Thread
Results 1 to 4 of 4

How to get Conditional Formatting to do this

  1. #1
    Registered User
    Join Date
    01-16-2016
    Location
    Earth, Universe
    MS-Off Ver
    MS Office 2007 SP3
    Posts
    13

    Question How to get Conditional Formatting to do this

    Hello there,

    I'm looking to do the following in excel.

    I have a column which can take a few values. I want the two adjacent-to-that-column cells to take on specific formatting depending on what the value in said reference cell in the column is.

    I only know how to make the change in the reference cell itself, not how to make it influence a different cell, nor how to do this for each set of cells in an entire column.

    So:
    A B C
    1 in lorem ipsum
    2 on dolor sit
    3 out amet consectetur

    If
    A1 = "in" or "on", B1 = blue text + white fill, C1 = blue fill + white text
    A1 = "out" or "under", B1 = red text + white fill, C2 = red fill + white text

    Same for about 3000 rows individually.

    Help?

  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: How to get Conditional Formatting to do this

    Let's assume the range to format is B1:C10.

    Select the ENTIRE range B1:C10 starting from cell B1.
    Cell B1 will be the active cell. The active cell is the
    one cell in the selected range that is not shaded. The
    formula will be relative to the active cell.

    Goto the Home tab>Styles>Conditional Formatting>
    Manage rules>New rule>Use a formula to determine
    which cells to format

    Enter this formula in the box below:

    =OR($A1="In",$A1="On")

    Click the Format button
    Select the desired style(s)

    Repeat the process for the other condition using this formula:

    =OR($A1="Out",$A1="Under")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-16-2016
    Location
    Earth, Universe
    MS-Off Ver
    MS Office 2007 SP3
    Posts
    13

    Re: How to get Conditional Formatting to do this

    A million times thanks!

    I know just enough to fulfill my purpose.


    Out of curiosity, in case I'll ever need it:

    Quote Originally Posted by Tony Valko View Post
    Select the ENTIRE range B1:C10 starting from cell B1.
    Cell B1 will be the active cell. The active cell is the
    one cell in the selected range that is not shaded. The
    formula will be relative to the active cell.
    "Relative to the active cell", what does this mean?

    Thinking out loud:

    B1 uses:
    =OR($A1="In",$A1="On")

    So in the next row (B2) it will apply:
    =OR($B1="In",$B1="On")

    What does it do about C1? What if I wanted a shift/fill/relativity by columns? It will do that automatically?
    And what if you didn't want the condition to be relative? So to check one cell (say, a sum?) as reference and then have it influence a range?

    Since this is just extra information I'll be equally content if you had a link where it is all explained. It'd go in my favorites anyway.

    In any case, my issue is solved. I'll save a lot of time.
    Thank you so much.

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

    Re: How to get Conditional Formatting to do this

    Quote Originally Posted by fluentox View Post
    Out of curiosity, in case I'll ever need it:
    "Relative to the active cell",
    what does this mean?
    That means the formula is written to reference the top left cell in the selected range.

    If you correctly select the entire range and correctly enter the formula, the cell references will change accordingly without having to enter a formula for each specific cell.

+ 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: 01-08-2016, 06:44 PM
  2. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  3. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  4. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  5. Replies: 2
    Last Post: 09-19-2013, 10:34 AM
  6. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  7. Replies: 3
    Last Post: 05-15-2012, 04:13 PM

Tags for this Thread

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