+ Reply to Thread
Results 1 to 9 of 9

Conditional formatting: putting 0 when the cell is blank doesn't work

  1. #1
    Forum Contributor
    Join Date
    05-20-2017
    Location
    Boston, US
    MS-Off Ver
    Mac 2011
    Posts
    139

    Conditional formatting: putting 0 when the cell is blank doesn't work

    Hello!

    My goal is to put 0 (or - ) into a cell in column B whenever the cell is blank (doesn't contain anything) and when the cell refers to subtasks (values in column A contain dots).

    I tried to formulas, none do the job correctly - they skip blanks, don't put zeros, etc.

    =IF(AND(MOD($A$3:$A15,1)>0,$B3=""),0,$B3)

    =IF(AND(MOD($A$20:$A28,1)>0,ISBLANK(B22)),0,$B12)

    I will be grateful for your help.

    I am also attaching a file.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,824

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    You can't add values to cells using conditional formatting.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    05-20-2017
    Location
    Boston, US
    MS-Off Ver
    Mac 2011
    Posts
    139

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    How can I replace blank cells with zero values then, if I have accounting format in cells?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,824

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    Try this custom number format:

    0;-0;-

    This will produce the following:

    1 for positive values

    -1 for negative values

    - for zero values

  5. #5
    Forum Contributor
    Join Date
    05-20-2017
    Location
    Boston, US
    MS-Off Ver
    Mac 2011
    Posts
    139

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    Quote Originally Posted by AliGW View Post
    Try this custom number format:

    0;-0;-

    This will produce the following:

    1 for positive values

    -1 for negative values

    - for zero values
    This is not suitable for my purposes. I use an accounting formatting, and it has a way more complicated code as I see when I open a formatting window.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,824

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    OK - but all I have done is adapted that code, you see? I thought that you wanted to replace 0 values with a simple dash. What would be really helpful is if you would simply state what you have got now (not formulae, but cell values) and what you want it to be. Your attachment really doesn't make that clear. Also, if your 'purpose' is relevant, then state it!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,824

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    Maybe this is what you want?

    _-$* #,##0_-;-$* #,##0_-;-

    In other words, just replace the third criterion in the format code to -.
    Last edited by AliGW; 08-02-2017 at 05:22 AM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,824

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    Are we there yet?

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Conditional formatting: putting 0 when the cell is blank doesn't work

    Quote Originally Posted by Vitalite View Post
    How can I replace blank cells with zero values then, if I have accounting format in cells?
    If you want to put Zero in blank cell, select the range press control+G->special->Check mark on blank->> All the blank cells will be select ->> put 0 and press control+Enter.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

+ 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: 02-28-2014, 07:12 AM
  2. [SOLVED] Conditional Formatting leaving cell blank if doesn't meet requirements
    By Rhiannon25 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-11-2013, 11:55 PM
  3. Conditional Formatting doesn't work after copy and insert
    By amarus99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2012, 02:52 PM
  4. Excel 2007 : AND doesn't work in Conditional Formatting
    By cellarir in forum Excel General
    Replies: 2
    Last Post: 03-21-2012, 06:10 PM
  5. Conditional formatting applied to a pivot table doesn't work as it should
    By Pichingualas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2012, 07:43 AM
  6. Replies: 3
    Last Post: 09-09-2009, 03:35 PM
  7. Replies: 2
    Last Post: 09-01-2005, 09:05 AM
  8. Replies: 0
    Last Post: 02-10-2005, 02:46 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