+ Reply to Thread
Results 1 to 16 of 16

SUM Only if Cell is not Blank

  1. #1
    Registered User
    Join Date
    10-13-2016
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    17

    SUM Only if Cell is not Blank

    I am trying to have the following calculate only if cell M:M is not blank.

    =SUM(W192*2+W193*Q3)

    The above works, but I need to add a function to only SUM if cell M:M has data.

    Thank You
    Attached Files Attached Files
    Last edited by cdxjones; 04-04-2017 at 04:13 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,721

    Re: SUM Only if Cell is not Blank

    Try this:

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

    Re: SUM Only if Cell is not Blank

    M:M is not a cell, it is a range, a cell would be M1.

    Now, having said that, do you need to test to see if ALL of M is blank, or just a certain cell?

    Also, you dont really need to use SUM like that, this should also work...
    =W192*2+W193*Q3
    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
    Registered User
    Join Date
    10-13-2016
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    17

    Re: SUM Only if Cell is not Blank

    Thank You, This worked...

  5. #5
    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: SUM Only if Cell is not Blank

    Ford made a good point. I didn't really read the formula. SUM is superfluous in this case (though does not cause an error).

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

  6. #6
    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,939

    Re: SUM Only if Cell is not Blank

    Thanks 6

  7. #7
    Registered User
    Join Date
    10-13-2016
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    17

    Re: SUM Only if Cell is not Blank

    I thought this was working... However the formula is calculating the first part of the calculation in BOLD below when range M:M is empty.

    =IF(COUNTA(M:M)=0,"",W192*2+W193*Q3

    Any thoughts?

  8. #8
    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,939

    Re: SUM Only if Cell is not Blank

    Quote Originally Posted by cdxjones View Post
    I thought this was working... However the formula is calculating the first part of the calculation in BOLD below when range M:M is empty.

    =IF(COUNTA(M:M)=0,"",W192*2+W193*Q3

    Any thoughts?
    Not possible. Are you sure M is blank? What do/did you have in M?
    Keep in mind that even if you have a formula that return "", that cell is not blank/empty

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: SUM Only if Cell is not Blank

    This implies W193 and Q3 are zero AND M:M is not empty i.e.a cell with a space will NOT be "Blank".

    Do "Clear Contents" on column M.

  10. #10
    Registered User
    Join Date
    10-13-2016
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    17

    Re: SUM Only if Cell is not Blank

    It is clear, let me clean this up and upload what I am looking at...

  11. #11
    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,939

    Re: SUM Only if Cell is not Blank

    OK, will wait for your file

  12. #12
    Registered User
    Join Date
    10-13-2016
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    17

    Re: SUM Only if Cell is not Blank

    Uploaded...

    Thanks

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: SUM Only if Cell is not Blank

    Column M has data in rows 2 and 3: so I think formula should be ..



    =IF(M3="","",$W$192*2+$W$193*O3)

    Copy down

    Edited to "fix" cells
    Last edited by JohnTopley; 04-04-2017 at 04:10 PM.

  14. #14
    Registered User
    Join Date
    10-13-2016
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    17

    Re: SUM Only if Cell is not Blank

    That was it... Did not catch that...

    Thank You...

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

    Re: SUM Only if Cell is not Blank

    M also has - in a bunch of cells, so they are not blank either.

    We come back to what I was getting to in post #3

  16. #16
    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: SUM Only if Cell is not Blank

    Quote Originally Posted by JohnTopley View Post
    Column M has data in rows 2 and 3: so I think formula should be ..



    =IF(M3="","",$W$192*2+$W$193*O3)

    Copy down

    Edited to "fix" cells
    Nice recovery. So it wasn't M:M to begin with....

+ 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] IF Cell is blank, calculate, if cell isn't blank, leave blank
    By amthyst826 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-04-2015, 03:54 PM
  2. [SOLVED] Populate Text in Cell based on blank/non-blank status of other cell(s)
    By cmkarnes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2015, 06:53 AM
  3. Calculate differnce between 2 dates, but if 1 date cell is blank leave cell blank
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-11-2014, 11:31 PM
  4. [SOLVED] Concatenate If Blank - remove blank line if first cell is blank
    By ker9 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-27-2014, 02:14 PM
  5. Replies: 3
    Last Post: 01-23-2014, 12:19 PM
  6. [SOLVED] Cell referenced in formula has no information displayed (shows blank), return blank cell
    By nunayobinezz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2013, 04:51 PM
  7. If cell blank OR another cell blank then show blank, if not display value
    By stevop622 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-09-2013, 04: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