+ Reply to Thread
Results 1 to 8 of 8

Formula to ignore blank cells with SUM?

  1. #1
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Formula to ignore blank cells with SUM?

    I want to SUM the last the two cells above, using A+B formula,but as a SUM formula it adds with blank cells .How to Sum only if any of the two cells are not blank?

    Example:


    A4=2395,4 B4=200 ---------- Formula:
    A5=2595,4 B5=444 -------- A4+B4
    A6=3039,4 B6=-339 ------- A5+B5
    A7=2700,4 B7=-500 ------- A6+B5
    A8=2200,4 B8= ----- A7+B7
    A9=2200,4 B9= ------ A8+B8
    A10=2200,4 B10= ----- A9+B9
    A11=2200,4 B11= ------ A10+B10
    A12=2200,4 B12= ------- A11+B11


    Want like this:

    A7=2700 B7=-500
    A8=2200,4 B8=0
    A9= B9=
    A10= B10=
    A11= B11=

    With B8=0 , A9 is blank and B9 is blank

  2. #2
    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,926

    Re: Formula to ignore blank cells with SUM?

    Add an IF statement...
    =if(and(a4="",b4=""),"",your-formula)
    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

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Formula to ignore blank cells with SUM?

    .
    Not certain I understand your question ... but won't this also provide the answers you are seeking ?


    A
    B
    C
    D
    E
    F
    G
    1
    2
    3
    4
    2395
    200
    2595
    Formula in C4 & drag down"
    5
    2595
    444
    3039
    =SUM(A4:B4)
    6
    3039
    -339
    2700
    7
    2700
    -500
    2200
    8
    2200
    2200
    9
    2200
    2200
    10
    2200
    2200
    11
    2200
    2200
    12
    2200
    2200

  4. #4
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Formula to ignore blank cells with SUM?

    The results are the same, If B is blank then cell A is repeated such A4=200 B5= A6=200 B6= I want A6 to be blank

    Result: =if(and(a4="",b4=""),"",A+B)

    A4=2395,4 B4=200
    A5=2595,4 B5=444
    A6=3039,4 B6=-339
    A7=2700,4 B7=-500
    A8=2200,4
    A9=2200,4

  5. #5
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Formula to ignore blank cells with SUM?

    I attached a workbook to show the problem
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Formula to ignore blank cells with SUM?

    Hi,

    For your sample file, in H5, enter and copied down:

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


    See attached.
    Attached Files Attached Files
    Last edited by jtakw; 08-20-2018 at 07:50 PM.

  7. #7
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Formula to ignore blank cells with SUM?

    The formula worked , Thankyou

  8. #8
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Formula to ignore blank cells with SUM?

    Quote Originally Posted by Mr.Castle View Post
    The formula worked , Thankyou
    You're welcome, thanks for the feedback.

    Add rep would be appreciated, click on the "Star" at the lower left corner of posts you found helpful.

    If your issue has been "Solved", please mark the thread as such, Thank You.

+ 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. CSV - Ignore Blank Formula Cells
    By almo136 in forum Excel General
    Replies: 1
    Last Post: 11-06-2017, 08:04 AM
  2. [SOLVED] how to count cells with values but ignore blank cells with formula and in a month?
    By Imran Magsi in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-17-2017, 03:58 AM
  3. [SOLVED] Ignore blank cells with formulas or ignore NA() in a formula
    By guiismiti in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-24-2016, 02:13 PM
  4. Ignore blank cells using formula
    By tcubed13t in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-30-2014, 09:12 PM
  5. Getting Excel to ignore Blank cells in a formula
    By SLOWBRAH in forum Excel General
    Replies: 2
    Last Post: 04-16-2014, 09:50 AM
  6. [SOLVED] Return non-blank cells from range AND ignore cells with only formula w/o results
    By grafitti in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-06-2014, 08:15 AM
  7. Getting formula to ignore blank cells
    By CDM in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2006, 06:07 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