+ Reply to Thread
Results 1 to 13 of 13

keep blank cells blank & 0 shows that is is 0?

  1. #1
    Forum Contributor
    Join Date
    06-19-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    169

    keep blank cells blank & 0 shows that is is 0?

    Hi

    I am trying to create a sumif formula that picks up data from another tab based on a selected cell.

    If that cell comes back blank i want the cell to be blank and not 0
    However, if the cell forumula comes back 0, i want it to be 0

    I used the formula if =0,"" but my cells that = 0 have come back blank too. But i want the cell for these to show 0

    How do i do this?

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

    Re: keep blank cells blank & 0 shows that is is 0?

    As advised in the yellow banner at the top of this page, providing a sample workbook is a good idea.

    HOW TO ATTACH YOUR SAMPLE WORKBOOK: Fast answers need clear examples. Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,037

    Re: keep blank cells blank & 0 shows that is is 0?

    Use, for example
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,234

    Re: keep blank cells blank & 0 shows that is is 0?

    TMS has shown the correct strategy, but I'm interested in exactly what your formula is, in particular whether it is dealing with arithmetic or text.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Forum Contributor
    Join Date
    06-19-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    169

    Re: keep blank cells blank & 0 shows that is is 0?

    Hi

    =IF(SUMIF('Set 1'!$C$16:$C$200,'Table (per min)'!$B30,'Set 1'!$E$16:$E$200)=0,"",(SUMIF('Set 1'!$C$16:$C$200,'Table (per min)'!$B30,'Set 1'!$E$16:$E$200)))

    This is my formula, but if a value = 0 it shows blank. But i dont want it blank, i want it to be 0.00, for example. I just want cells that = blank, to stay blank

    However, if i change the formula above to ="","" rather than =0,"", a blank cell actually then comes up as 0.00 (which i dont want)

    =IF(SUMIF('Set 1'!$C$16:$C$200,'Table (per min)'!$B30,'Set 1'!$E$16:$E$200)="","",(SUMIF('Set 1'!$C$16:$C$200,'Table (per min)'!$B30,'Set 1'!$E$16:$E$200)))

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,037

    Re: keep blank cells blank & 0 shows that is is 0?

    With 365, your formulae can be written more briefly/concisely like this:

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

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


    Logically, if you have a SUMIF, the result will be zero or a value other than zero. You cannot get a null value out of a SUMIF (AFAIK). So, if you test for zero, you will get a null value returned (if the result is zero), or the value of the SUMIF. If you test for a null value, you will always get the value of the SUMIF, regardless of its value. Hence you see 0 when the SUMIF evaluates to zero.

    If that doesn't help, please upload a sample file.


    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,037

    Re: keep blank cells blank & 0 shows that is is 0?

    Just to reiterate: a SUMIF will not return a null value.

    Here's a sample file.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,528

    Re: keep blank cells blank & 0 shows that is is 0?

    I'm struggling to understand exactly what is going on here. I mean, I can understand the formula as written, but I'm wondering exactly what is meant by "cells that=blank to stay blank."

    Maybe this will help clarify -- exactly what "cell that is blank" are you referring to?

    Wild guess: The current SUMIF() is summing the values in column E of "Set 1" whenever the value of column C of "Set 1" matches the value in B30 of "Tables per min." I'm guessing that "Set 1" is a "database" of sorts, and it seems unlikely that all of the cells in columns C or E will be truly blank. Wild guess is that you want a blank in B30 of "Tables per min" to be propagated as a blank. Something like =IF('Table (per min)'!$B30="","",SUMIF(...)). This variation only performs the SUMIF() when there is something meaningful in B30. If B30 is blank (or null string), then the SUMIF() is ignored.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  9. #9
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,272

    Re: keep blank cells blank & 0 shows that is is 0?

    Maybe this:

    =IFERROR(SUM(FILTER('Set 1'!$E$16:$E$200,'Set 1'!$C$16:$C$200='Table (per min)'!$B30,"")),"")

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,037

    Re: keep blank cells blank & 0 shows that is is 0?

    Isn't that saying, if there are no matching values, the FILTER will return a null. The SUM will then return #VALUE! and the IFERROR will give you a null value back.

    Isn't that the same as MrShorty's suggestion of =IF(B30="","","Original formula")

  11. #11
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,272

    Re: keep blank cells blank & 0 shows that is is 0?

    Isn't that the same as MrShorty's suggestion of =IF(B30="","","Original formula")
    I don't think so. I think MrShorty's is checking to see if B30 is blank. Mine is saying, if there's no match to B30 (in COL C), then make it blank and if there is a match but the value is 0 in COL E, then show 0.

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,037

    Re: keep blank cells blank & 0 shows that is is 0?

    Ah, ok. I was obsessing on the blanks. In my testing, I have blanks in column C with values in column E.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,887

    Re: keep blank cells blank & 0 shows that is is 0?

    It would all be so much easier if the OP would provide a small sample worksheet as requested instead of us having to simulate it.

+ 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. Pivot table shows my blank cells as 0, how do i leave them blank
    By ACrossley1 in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 08-21-2019, 03:07 AM
  2. My formula result shows in blank cells
    By chrisellis250 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2018, 08:42 AM
  3. Count blank cells in a range and contiguous blank cells also as single cells! Tricky One!
    By SebastianColombia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2015, 02:32 PM
  4. [SOLVED] Keeping a cell blank if the related cells shows
    By Anuru in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-24-2014, 05:27 AM
  5. [SOLVED] Autofilter by blank cells in one column and also shows row above it
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2014, 08:55 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. Delete cells that contain a function that shows up blank
    By ISARTC3 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-20-2005, 02:16 PM

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