+ Reply to Thread
Results 1 to 10 of 10

Add two cells and one cell is blank

  1. #1
    Registered User
    Join Date
    11-01-2009
    Location
    Pennyslvania, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Add two cells and one cell is blank

    When I use the formula below and either H7 or I7 is blank I get a blank answer J7. When I remove the IFERROR I get a value error. Any ideas


    =IFERROR(IF($H7=$I7,"",SUM($H7-$I7)),"")

  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,721

    Re: Add two cells and one cell is blank

    If either H7 or I7 is blank, what result do you want? Where does J7 come into play--is that the cell with the formula?

    No need to use SUM here, by the way.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-01-2009
    Location
    Pennyslvania, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Add two cells and one cell is blank

    J7 is where the formula is below. I just want it to subtract the two cells and if it equals zero I want it to be blank (“”)

  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,916

    Re: Add two cells and one cell is blank

    Try this:

    =IF($H7-$I7=0,"",$H7-$I7)
    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.

  5. #5
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Add two cells and one cell is blank

    Or use a customized format with #,#,"" to hide zero values.

  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,916

    Re: Add two cells and one cell is blank

    Honestly, I think this is a bad idea. I have only this week seen one forum member getting extremely confused because they had done something similar and then forgotten. At least if it's built into the formula, it's easy to find out why zeroes are not showing.

  7. #7
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Add two cells and one cell is blank

    Hi AliGW
    I honestly do not think that way because formatting is more efficient. I understand that for a small group of cells the formula is used, but for a large range of cells with sparse values it will not be usable, in my opinion.

  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,916

    Re: Add two cells and one cell is blank

    Then we shall have to agree to disagree.

    It's perfectly usable on large data - why wouldn't it be? Maybe you mean something other than 'usable'?

  9. #9
    Registered User
    Join Date
    05-21-2014
    Posts
    92

    Re: Add two cells and one cell is blank

    either H7 or I7 is blank
    When you say "blank", exactly how is H7 or I7 "blank"? Is it an invisible zero? Is it truly an empty cell with nothing typed in it? Is it a formula that results in "" as a result? Or is it a " "? (<- Note that there is a space between the quotes.)

    Just to let you know, I got the same situation as you when " " (note the space) was in one cell or the other. Make sure your "blank" cell is not actually invisible text.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,056

    Re: Add two cells and one cell is blank

    I'm with Ali on this one...
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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: 2
    Last Post: 08-13-2018, 02:30 AM
  2. [SOLVED] If two cells are blank then return blank, else vlookup cell with populated data
    By Jason G in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-06-2017, 10:20 AM
  3. Replies: 11
    Last Post: 09-15-2014, 02:36 AM
  4. Replies: 2
    Last Post: 11-22-2013, 01:07 PM
  5. Replies: 2
    Last Post: 04-29-2013, 04:20 AM
  6. Replies: 0
    Last Post: 03-05-2013, 09:22 AM
  7. Find a blank cell and calculate the average of all cells above till the next blank
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 11:51 AM

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