+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

  1. #1
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

    Hello Excel frineds
    For my study i need to format the cells in the way you see in thi Pic, simple every time I found a TRUE I also need to format the 2 cells below with FALSE

    A
    1
    TRUE
    2
    FALSE
    3
    FALSE
    4
    FALSE
    5
    FALSE
    6
    FALSE
    7
    FALSE
    8
    FALSE
    9
    TRUE
    10
    FALSE
    11
    FALSE
    12
    FALSE
    13
    FALSE
    14
    FALSE
    15
    FALSE
    16
    FALSE
    17
    FALSE
    18
    FALSE
    19
    FALSE
    20
    FALSE
    21
    FALSE
    22
    FALSE
    23
    FALSE
    24
    TRUE
    25
    FALSE
    26
    FALSE
    27
    FALSE


    Thank you for yuor Help

  2. #2
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

    This seems to work.

    Pete
    Attached Files Attached Files

  3. #3
    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,420

    Re: Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

    Maybe this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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


  4. #4
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

    Woow!! TMS Thank You so much, I will never understand it but it works perfectly
    SolVED

    EDIT Also thanks to Pete, it works fine either
    Last edited by XLalbania; 11-02-2018 at 04:57 PM.

  5. #5
    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,420

    Re: Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

    You're welcome. Thanks for the rep.

    You have a single OR formula with three possible conditions. If any condition is TRUE, then the formula returns TRUE. The first condition is a simple comparison: is Cell A1 TRUE? As this condition is dragged down, it will refer to cells A2, A3, A4 and so on. For the sake of argument, let's think about Cell A3; if A3 is TRUE, then the result is TRUE. But we also need to check the previous two cells, A2 and A1 to see if either of them are TRUE.

    In order to check the previous cells, we are using INDEX. The INDEX function returns a cell from a range depending on a "pointer". For the second condition, we are using ROW()-1, and for the third, we are using ROW()-2. The ROW() function returns the row number for the current cell. Hence, ROW()-1 refers to the previous cell row, and ROW()-2 refers to the cell row prior to that.

    In this case, on row 3, INDEX(A:A, ROW()-1) refers to cell A2 and INDEX(A:A, ROW()-2) refers to cell A1. So, effectively, we are checking if cells A3, A2 or A1 are TRUE and, if any one of them is, the OR formula will return TRUE.

    That's OK for cell A3 down if we drag the formula down, as we refer to cells A4, A3, A2, then A5, A4, A3, and so on. BUT, if we drag up from row 3, we are going to get an error because the "pointer" will go zero and then go negative. That's why we use IFERROR to cater for the error generated and we make that return FALSE.

    Surprisingly, at least to me, I didn't need the IFERROR on the middle condition, but it wouldn't hurt.

    So, belt and braces,
    Formula: copy to clipboard
    Please Login or Register  to view this content.




    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.

  6. #6
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

    Great!! TMT
    great explanation, thank you for your time I appreciate I Put Solved
    see you next

  7. #7
    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,420

    Re: Conditional Formatting when I've 1 TRUE i need to color also 2 FALSE

    You're welcome.

+ 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. [SOLVED] Conditional formatting color change if any in row is true
    By CLSSY56 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-08-2018, 11:59 AM
  2. [SOLVED] Conditional Formatting not recognizing TRUE or FALSE
    By jimmisavage in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-09-2017, 05:53 AM
  3. [SOLVED] Conditional Formatting a cell from a "true/false" VLOOKUP
    By Solidstan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-12-2013, 10:54 AM
  4. True/False Conditional Formatting Icon Style
    By chasepes in forum Excel General
    Replies: 3
    Last Post: 07-07-2010, 11:18 AM
  5. Conditional Formatting for True/False
    By Phil H. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2005, 05:20 PM
  6. Want to change the color of a true/false logical statement with i.
    By gregspainting in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2005, 03:06 PM
  7. How can I make a True or False statement a certain color when usi.
    By Wendy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2005, 02:06 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