+ Reply to Thread
Results 1 to 9 of 9

How to solve conditional formatting ruling 'TRUE' when cell is blank

  1. #1
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Exclamation How to solve conditional formatting ruling 'TRUE' when cell is blank

    Hi there,

    This is my first post here and I believe I will be coming back quite a lot as I am currently building an excel worksheet/program to prioritize my workload. I currently have a rule set for one of my cells (A). Cell (A) will turn red IF it is blank AND IF the shipping date (B) in another cell is less than or equal to today's date using the following formula:

    =IF(ISBLANK(A), AND((B)<=TODAY()))

    The problem is, if there is no date entered in (B), then the formula is TRUE for some reason, causing (A) to be highlighted red and I'm not sure why.

    I tried the following equation to fix it (though I am no expert):

    =IF(ISBLANK(A), AND(IF(NOT(ISBLANK(B)))), AND((B)<=TODAY()))

    The formula did not work and I can't find the proper way to write it. I then tried to create another rule to override it using, IF(ISBLANK(B)), but that did nothing as well.

    Any help will be greatly appreciated! More questions to come.
    Last edited by Keegan1116; 02-18-2020 at 12:06 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    If a cell is blank, and then used in an arithmetic expression, it will be treated as 0. So if B is blank, it will always be < TODAY().

    You cannot use A and B in this formula. You must use cell references, like A1 and B1.

    I also think your boolean logic is a bit challenged. You are using an IF function, but only returning a value when the condition is TRUE. FALSE will be returned by default in the FALSE case, which is probably OK for conditional formatting. In any case, for conditional formatting it is usually better to use a boolean expression that just evaluates to TRUE or FALSE without wrapping an IF around it.

    I don't know if A and B have formulas that return blanks, or are simply empty. If a cell has a formula that returns a blank, like

    =IF(Z9>4,"","")

    then ISBLANK will be FALSE, even though the cell looks blank.

    Please try this formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    Hi and welcome to the forum

    As a CF

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    I understand what you're saying - I just used A and B to make it easy to read. I reference the actual calls in my sheet. The reason I can't do what you're saying is because I still need to be able to change the date at any time without erasing the formula. The formula in my post is actual input in a rule, "Use formula to determine which cells to format", therefore I can't really input a value for false as there is none, the rule would just not apply. Also, I need cell A to be true if it is equal to B as well, so that I know it is a deadline.

    I hope I'm making sense, and please tell me if I'm just not understanding this properly, as I am very new to all of this. Thanks for your response

  5. #5
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    Quote Originally Posted by Richard Buttrey View Post
    Hi and welcome to the forum

    As a CF

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you so much!! This worked

  6. #6
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    Quote Originally Posted by Richard Buttrey View Post
    Hi and welcome to the forum

    As a CF

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Can I ask (just so I understand correctly), how come we add the B1>0? Would that not cancel out the B1<=TODAY()?

  7. #7
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    No, it will not cancel.
    As it is used inside AND, both conditions B1>0 and B1<=TODAY() has to be fulfilled at the same time.

    So let's see at Jan 1st, 2020 - it was 43831 day in Excel calendar. It is both >0 and <= TODAY(), as today = Feb 18, 2020 is 43879th day of Excels calendar



    The result of whole formula will be true only if ALL 3 tests will be true
    Best Regards,

    Kaper

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    ..and just to conclude Kaper's explanation one of the conditions was that B1 should not be blank. If B1 is blank it will evaluate as zero and B1>0 will be False and hence the whole AND() function will be false. So we test for B1 being greater than zero

  9. #9
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Re: How to solve conditional formatting ruling 'TRUE' when cell is blank

    I see. Thanks for clearing that up. I forgot about excel and its strange little gimmicks!

+ 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] blank on cell with no value with conditional formatting
    By chaiyya345 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-16-2019, 10:51 PM
  2. Replies: 1
    Last Post: 06-30-2017, 06:33 PM
  3. [SOLVED] Can Conditional Formatting solve my problem?
    By jiwil in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-02-2014, 04:57 AM
  4. [SOLVED] Conditional formatting-if cell is blank it says BLANK
    By KK1234 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-04-2013, 04:27 AM
  5. How can I solve conditional formatting problem?
    By Indra Rai in forum Excel General
    Replies: 3
    Last Post: 03-14-2012, 08:33 AM
  6. Replies: 4
    Last Post: 03-05-2012, 04:29 PM
  7. Conditional Formatting - when the cell is blank
    By greg8788 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2008, 11:50 AM

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