+ Reply to Thread
Results 1 to 26 of 26

Don't display zero values

  1. #1
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Don't display zero values

    I have a column of data that I'd like to visualize in a line chart. The cells in the column contain formulas that calculate numbers added to other sheets every month. The adjacent column has the names of each month. New data appears when the data for the month is added.

    I'd like to ask the chart to not display the values that are currently zero, because we haven't arrived at that month yet. So, for instance, the cell in the column for November 2011 has a zero, because the range it sums has no data in it yet.

    Is there a way to do this without having to go back to each chart every month and change the range to add-in the new data?

    Thank you, very much, for any help!
    Last edited by Nate Westcott; 10-17-2011 at 02:23 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Don't display zero values

    alter your formula to output NA() instead of what I assume you are currently using which is ""

    Use CF on the cells to hide the #N/A value if that is an issue.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    I'm a bit new to Excel formulas; I'm excited to learn, and I appreciate the help.

    If my formula were
    Please Login or Register  to view this content.
    But I want to allow for data added through $H$32, how would I represent output NA() in the formula?

    I'm not seeing an #N/A value for these cells.

    Thank you!

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Don't display zero values

    not sure what that formula is meant to mean.

    Can you post example workbook of what you currently have.

  5. #5
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    Why don't you create the line chart from data that indirectly references your chart? By creating a vlookup table that references your data, it will only pull data where the month is entered in table one on my sample and in turn your cahrt will update and include that month in the lines. The dynamic ranges are stored in the name manager which you can find on the data tab, once created, in the Select Data dialogue on the chart select the apppropiate name range Hopefully this makes sense once you see the sample
    Attached Files Attached Files
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  6. #6
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    I've attached a sample sheet with the arrangement of data I have.

    I imagine this isn't the best way to arrange this, so I'm quite open to suggestions.

    Thank you so much for your help!
    Attached Files Attached Files

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Don't display zero values

    formula in Totals!C3 , then copy down.

    =IF(Apples!$B2="",NA(),Apples!$B2)

  8. #8
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    Thank you - this is certainly closer to what I was hoping to do. With the change, my question also changes a bit.

    Is there a way to ask the chart to not display the months where the value is N/A?

    Ideally, I would like to extend the range for the chart out a few years, so that when a value is added, the new month and the value appears.

    In other words, ideally, when the new values for October are added, the chart would then display October's value total, without showing October before that at all.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Don't display zero values

    See the other reply about dynamic named ranges.

    Or see this
    Attached Files Attached Files
    Last edited by Andy Pope; 10-17-2011 at 09:58 AM.

  10. #10
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    Following the above example workbook, I've modified mine to include dynamic name ranges, but I'm having trouble understanding how to modify my formula to reflect the totals.

    I've attached the new version, and thank you for having a look!

    A simple question, but what does the 3,0 refer to in the formula:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Don't display zero values

    No idea. You seem to have spun off on a tanget.

  12. #12
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    The Vlookup is wrong because the original range it applied to has been checged, the 3 should refer to column 3 but it's now refering to a single column. I'm having a look at the sample now

  13. #13
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    Quote Originally Posted by scottylad2 View Post
    The Vlookup is wrong because the original range it applied to has been checged, the 3 should refer to column 3 but it's now refering to a single column. I'm having a look at the sample now
    Thank you - and this is very helpful; I've not used the vlookup function yet.

    In the end, the chart would ideally display only the data of the totals that are now in the "Current Data" column, not the individual values for Apples, Oranges, and Pears. I appreciate your help, and I'm learning a lot from this!
    Last edited by Nate Westcott; 10-17-2011 at 11:58 AM.

  14. #14
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    I think you're maybe not too familiar with Dynamic named ranges, well worth a read up on them. In the sample i'm attaching, the sheet marked Totals will house your DISPLAY data, ie your chart and the tanle the chart is referencing and also a summary of the data thats being collected from the INPUT taps, Apples Oranges and Pears. If you go into the Apples tab, hold control and tap F3 on your keyboard, when the name dialogue box pops up, highlight the word Apples, then at the bottom of the box click on the checkered pattern at the right hand side and you will see what part of the data is being refered to in the dynamic range.

    Come out of that then enter some data next to November and do the same, you'll see it's now including that data

    The same happens in the orange and Pears tabs, as soon as you add data in any of the Fruits Tabs it gets added to the Totals Tab in table that shows your Fruits. The green box now references to that to hold the data for the chart

    fel free to ask if theres a part your not understanding

    On the chart, the new month is now visible also. You only need input into any of the tabs marked as fruits, never into the Totals tab
    Attached Files Attached Files
    Last edited by scottylad2; 10-17-2011 at 12:40 PM.

  15. #15
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    I may have edited this since you last looked

  16. #16
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    Quote Originally Posted by "The page at excelforum.com"
    You must spread some Reputation around before giving it to scottylad2 again.
    This is precisely the solution I've been seeking. I will most assuredly read-up further on Dynamic Name ranges; this is powerful and enormously useful knowledge. Thank you so much!!

  17. #17
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    Thanks for the feedback, glad to help

  18. #18
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    Can anyone suggest a way to represent months of the year in a Dynamic Name range, when I anticipate (or already have in my data), many years? The problem is that a list like:
    Please Login or Register  to view this content.
    ...repeats the values every year. Ideally, I'd like to represent the year next to the January label for each year.

    Also, how should I have the values formatted? In other words, should I use the "date" custom formatting, or "General", or "text"? What would be best for Dynamic Name ranges?
    Last edited by Nate Westcott; 10-18-2011 at 01:22 PM.

  19. #19
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    Can you clarify, is your Data set up in one continuous column of Dates? ie A1:A100 will that be a bix of months and years so you might have jan 2001 data in the same column as jan 2002?

    a fresh sample would help

  20. #20
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    I've attached a sheet which features my current format in column A and my ideal format in column C.

    Thanks so much for having a look!
    Attached Files Attached Files

  21. #21
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    I'm not sure how you could seperate the months in that fashion and then use them in a chart or any meaningful sum because only one year and manth are tied, the rest are just text entries and october is october, if you don't keep it as a date with a year beside then I'm not sure how you can seperate one year from the other.

    But some of the Gurus on here might. I advise you start a new thread, with a sample attached of what you want and also what you want to do with the data, ie if it;s for using in a chart or other calculation. I'm off out now but will look on later

  22. #22
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    I'll keep the months the way they're formatted; another challenge for another time!

    One further question I have regards column G in your attached example ("DynamicRanges.xls"). I've created a Dynamic range for my months, but when I enter a month from the defined range, "Feb-10" for example, I don't see a total appearing in column H.

    I've attached another example, that's closer to what I'm working with.

    Do I need to enter anything into Column G, other than the value of the month? My understanding is that I don't need to populate the column with formulas, but that the values will appear in H when I enter in G.

    I'm wondering if the extent of my ranges in the Dynamic Ranges has something to do with it. I have it set to "200" in some, and others, just to the end of Dec-2016.

    Also, in my attached example, in the formula in the H, I was seeing a return of "0" for the months that didn't have values to sum. I removed the "$" signs from the formula in H, which resolved the problem - but I wonder if it has something to do with my error.

    Thank you, very much, for your help!
    Attached Files Attached Files

  23. #23
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Don't display zero values

    I posted an answer to this last night but it doesn't appear here, maybe I added to the wrong post....ooops!

    The Formula in G needs entered with Ctrl + Shift + Enter, not just enter

    Extend your ranges to much further than your ever likely to need, if you think your data will fill a max of 500 rows, set the Counta to be looking at 1000 rows. Do that rather than whole column refs, calculation times can be affected using whole column ref's imho

  24. #24
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Don't display zero values

    Thank you, scottylad2 - this is an elegant and functioning solution, and I've learned a lot! Solved indeed!

  25. #25
    Forum Contributor
    Join Date
    09-22-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    184

    Re: Don't display zero values

    Quote Originally Posted by Andy Pope View Post
    alter your formula to output NA() instead of what I assume you are currently using which is ""

    Use CF on the cells to hide the #N/A value if that is an issue.
    Hi Andy,

    What CF stand for?

  26. #26
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Don't display zero values

    CF is Conditional Formatting.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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