+ Reply to Thread
Results 1 to 8 of 8

Rainbow conditional formatting for a range based of date...

  1. #1
    Forum Contributor
    Join Date
    01-18-2016
    Location
    OBX NC
    MS-Off Ver
    Office 2013
    Posts
    153

    Rainbow conditional formatting for a range based of date...

    First let me say I have gained a lot of knowledge and really appreciate all of the help.

    I currently have 5 columns that have numbers a-e. Column K holds a date past or future.... K10 is today's date. I need cells in a-e only to display color if date is in future and based off cells L14:P14

    I have tried using formula(and statement) but what happens is that it changes all cells to one color, or no color at all. I have attempted to clear all formatting but same results. I have posted a sample including cell a1 that is blank but should not be based on date and l11
    If I just use cell equals then point (l:p) it works, but not based off date - I hope that makes sense.

    Again, Thank you guys so much, I really appreciate your time and expertise!

    Thanks again,
    Jack
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Rainbow conditional formatting for a range based of date...

    You cant use a range in an AND statement like that, try this instead
    =AND(A1=$L$13,K1>=INT($K$10))
    Also, if you want this to apply to all cells in that range, dont use $
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    01-18-2016
    Location
    OBX NC
    MS-Off Ver
    Office 2013
    Posts
    153

    Re: Rainbow conditional formatting for a range based of date...

    FDibbons,
    I attempted to do what you said... and get same results as before - all same color or none whatsoever.
    What am i missing. I have no hair, because i have pulled it all out!

  4. #4
    Forum Contributor
    Join Date
    01-18-2016
    Location
    OBX NC
    MS-Off Ver
    Office 2013
    Posts
    153

    Re: Rainbow conditional formatting for a range based of date...

    Thanks FGibbons! Think I got it...Removed the $ and kept cell as a1 throughout.... I believe that did it... Again thank you!

  5. #5
    Forum Contributor
    Join Date
    01-18-2016
    Location
    OBX NC
    MS-Off Ver
    Office 2013
    Posts
    153

    Re: Rainbow conditional formatting for a range based of date...

    FDibbins...Its doing same thing as before...I am going bezerk to just figure out what the logic that is making this fail. I used your forumla - took out the $ and thought all was good. Can you show me example in my posted attachment. Trust me my man, this is driving me bonkers!

  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Rainbow conditional formatting for a range based of date...

    Hello jackf-nc,

    The $ prevents the row or the column to change, depending on where it is in the cell reference.

    For example in the formula Ford provided, $K$10 means even if you drag the formula up, down, left or right, the cell reference will not change. Same goes to $L$13.

    If you want the cell reference to change when you drag it left and right, but not up and down (I assume that this is what you want), change $L$13 to L$13 instead (Locking the row reference).

    If you want to do it the other way around, change it to $L13 (locking the column reference).

    Edit: You should also change the reference for K1 too - $K1 to lock the column / K$1 to lock the row / $K$1 to lock both row and column.

    An example is
    Please Login or Register  to view this content.
    Applying to L1:P6 in your example
    Last edited by Lemice; 05-22-2016 at 10:49 PM.
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Rainbow conditional formatting for a range based of date...

    OK based on your instructions in post 1...
    I currently have 5 columns that have numbers a-e. Column K holds a date past or future.... K10 is today's date. I need cells in a-e only to display color if date is in future and based off cells L14:P14

    I have tried using formula(and statement) but what happens is that it changes all cells to one color, or no color at all. I have attempted to clear all formatting but same results. I have posted a sample including cell a1 that is blank but should not be based on date and l11
    If I just use cell equals then point (l:p) it works, but not based off date - I hope that makes sense.
    I have adjusted the CF formula to get the 1st row "correct". What I often do when working with a complex CF formula is to construct it IN the worksheet. CF only works on TRUE or FALSE (or 1/0), so you just need to construct the formula to return that....
    A
    B
    C
    D
    E
    1
    11
    12
    23
    25
    32
    2
    3
    16
    35
    37
    51
    3
    18
    20
    27
    31
    38
    4
    5
    25
    32
    56
    64
    5
    8
    12
    20
    37
    67
    6
    5
    7
    11
    36
    65
    7
    8
    9
    TRUE
    TRUE
    TRUE
    TRUE
    TRUE
    10
    FALSE
    FALSE
    FALSE
    FALSE
    FALSE
    11
    FALSE
    FALSE
    FALSE
    FALSE
    FALSE
    12
    FALSE
    FALSE
    FALSE
    FALSE
    FALSE
    13
    FALSE
    TRUE
    FALSE
    FALSE
    FALSE
    14
    FALSE
    FALSE
    FALSE
    FALSE
    FALSE

    A9=AND(A1=L$13,$K1>=K$10)
    copied across and down.
    This is the formula I used in CF and the 1st row looks like it worked.
    (you dont need INT() btw, the way you are using it, it strips out the decimal, but you have only dates that have no decimal)

    Now, Im not sure what that 1st part is supposed to be doing, or what it is supposed to be referencing?
    =AND(A1=L$13,$K1>=K$10)

  8. #8
    Forum Contributor
    Join Date
    01-18-2016
    Location
    OBX NC
    MS-Off Ver
    Office 2013
    Posts
    153

    Re: Rainbow conditional formatting for a range based of date...

    FDibbons,

    I have update new copy of sheet. If you take a look at what the CF is set to you will see what I am trying to do

    Thanks for all your help. This just has been driving me nuts.
    Attached Files Attached Files

+ 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. Conditional Formatting - Colouring % of mulitple cells based on date range
    By yeahyeah93 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2014, 09:22 AM
  2. [SOLVED] Conditional formatting dates based on date range and day - pt2
    By dancing-shadow in forum Excel General
    Replies: 5
    Last Post: 01-13-2014, 07:12 AM
  3. [SOLVED] Conditional formatting dates based on date range and day
    By dancing-shadow in forum Excel General
    Replies: 4
    Last Post: 01-07-2014, 01:45 PM
  4. Conditional Formatting via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  5. Conditional Formatting - Grey Out and Lock A range based on a cell value in that range
    By Excelgnome in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2012, 07:31 PM
  6. Replies: 8
    Last Post: 11-15-2011, 12:29 PM
  7. Conditional formatting of one cell based on date range of another cell
    By raggatip in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-02-2010, 02:11 AM
  8. [SOLVED] Conditional formatting based on date range
    By RGB in forum Excel General
    Replies: 3
    Last Post: 05-23-2006, 12:45 PM

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