+ Reply to Thread
Results 1 to 15 of 15

Blank Cells & Zeros

  1. #1
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Blank Cells & Zeros

    I have Cells A1, B1, & C1. I want C1 to display the total of A1+B1. Cell C1 is to be blank until numbers are entered. If I enter "0" in A1, THEN C1 will display a zero.
    If I only place a zero in B1, THEN C1 will display a zero. I cannot wrap my head around the syntax of blanks and zeros. I know it sounds easy, but it is killing me!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Blank Cells & Zeros

    Try this in C1:

    =IF(AND(A1>0,B1>0),A1+B1,"")

    Hope this helps.

    Pete

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

    Re: Blank Cells & Zeros

    How about this?

    =IF(A1+B1>0,A1+B1,"")
    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

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Blank Cells & Zeros

    Ford,

    one of the cells could still be blank and you would get a result.

    Pete

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

    Re: Blank Cells & Zeros

    @ Pete

    hmm true
    maybe...
    =IF(countif(A1:B1,0)>1,A1+B1,"")

  6. #6
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Blank Cells & Zeros

    Note that in Excel 0 > [space] > =""

    If somehow A1 or B1 takes on one of the second two values (a space or empty string), any formula involving >0 will not work. Just to pile on, here's my suggestion: =IF(AND(ISNUMBER(A1),ISNUMBER(B1)),SUM(A1:B1),"")

  7. #7
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Unhappy Re: Blank Cells & Zeros

    It doesn't work. I've tried them all.

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Blank Cells & Zeros

    Maybe..

    =IF(COUNT(A1:B1),IF(A1="",B1,SUM(A1:B1)*(A1<>0)),"")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  9. #9
    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,929

    Re: Blank Cells & Zeros

    OK long way around...

    =if(or(A1=0,A1="",B1=0,B1=""),"",A1+B1)
    I want C1 to display the total of A1+B1. Cell C1 is to be blank until numbers are entered. If I enter "0" in A1, THEN C1 will display a zero.
    If I only place a zero in B1, THEN C1 will display a zero.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Blank Cells & Zeros

    I find the wording confusing but maybe this will work for you.
    If a 0 is entered in either A1 or B1 and the other cell is blank, the result will be blank. If a number other than 0 is entered in either A1 or B1, C1 return that number. If a number other than 0 is entered and a value not a number is entered into the other cell, C1 will be blank.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  11. #11
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Re: Blank Cells & Zeros

    "If a 0 is entered in either A1 or B1 and the other cell is blank, the result will be blank." <- This is NOT what I want; the result should be zero.

  12. #12
    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,929

    Re: Blank Cells & Zeros

    change mine to this...
    =if(or(A1=0,A1="",B1=0,B1=""),0,A1+B1)

  13. #13
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Blank Cells & Zeros

    =if(count(a1:b1),a1+b1,"")
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  14. #14
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Blank Cells & Zeros

    =if(count(a1:b1),SUM(a1:b1),"")

  15. #15
    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,929

    Re: Blank Cells & Zeros

    =if(or(and(A1=0,A1=""),and(B1=0,B1="")),0,A1+B1)

+ 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] Concatenate and remove zeros from blank cells
    By JO505 in forum Excel General
    Replies: 4
    Last Post: 11-17-2020, 06:31 PM
  2. leave cells blank without zeros
    By dodger999 in forum Excel General
    Replies: 3
    Last Post: 09-19-2009, 11:20 AM
  3. Blank Cells Plotting as Zeros
    By ChristiaanV in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-13-2006, 11:31 PM
  4. References to Blank Cells turn into Zeros
    By statusquo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-12-2005, 10:50 PM
  5. Replies: 1
    Last Post: 10-13-2005, 09:39 AM
  6. blank cells v. zeros
    By JessNY in forum Excel General
    Replies: 1
    Last Post: 08-05-2005, 03:05 PM
  7. [SOLVED] Replacing blank cells with zeros
    By Ben in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2005, 05:08 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