MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 2nd, 2002, 09:18 PM   #1
DanExcel
New Member
 
Join Date: Mar 2002
Posts: 29
Default

Summary: Is there a way to make a chart not display "0" values?

Details: I have a chart that display all the data in a column. I want it to stop displaying at the row that has a zero in it. So, if my Y-values are in column D, and everything under D300 is 0, I want the chart only to display values upto the 300th row. I am willing to do this within "normal" excel or with visual basic.

Any suggestions? Please let me know if the question is unclear.

-DanExcel
DanExcel is offline   Reply With Quote
Old Apr 3rd, 2002, 10:17 AM   #2
Damon Ostrander
MrExcel MVP
 
Damon Ostrander's Avatar
 
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
Default

Hi DanExcel,

There are myriad ways of accomplishing this, but the easiest is probably just to modify your formulas or whatever produces the data to leave the cells empty rather than writing zeroes in them. If a formula returns the zero you could modify it thus:

=IF(your formula=0,"",your formula)

to yield an empty cell rather than a zero. Of course, the chart options must be set to not plot empty cells (Tools -> Options -> Charts tab).
__________________
Keep Excelling.

Damon

VBAexpert Excel Consulting
(My other life: http://damonostrander.com )
Damon Ostrander is offline   Reply With Quote
Old Apr 3rd, 2002, 10:26 AM   #3
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Better make that...

=IF(D2,D2,#N/A)

Use this formula to produce your Y values from the values in column D.

Damon, a cell containing "" isn't empty.
Mark W. is offline   Reply With Quote
Old Apr 3rd, 2002, 10:58 AM   #4
DanExcel
New Member
 
Join Date: Mar 2002
Posts: 29
Default

Damon and Mark,

I appreciate both of your replies. I had actually already tried Damon's suggestion, and found that it would still plot the values as "0". Using #N/A works better because it does not plot the values at all.

It does, however, still expand the graph scale so that it will fit all of the accomoate all of the cells used in the clumn, as if they had data. If you know somehow to make it actually scale to the data that is there, that would be helpful.

Thank you for your input. Let me know if I can clear anything up.

-DanExcel
DanExcel is offline   Reply With Quote
Old Apr 3rd, 2002, 11:03 AM   #5
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
If you know somehow to make it actually scale to the data that is there, that would be helpful.

Thank you for your input. Let me know if I can clear anything up.

-DanExcel
This can be accomplished using dynamic ranges. Are you familiar with 'em?

Take a look at http://www.mrexcel.com/board/viewtop...ic=267&forum=2.

[ This Message was edited by: Mark W. on 2002-04-03 10:05 ]
Mark W. is offline   Reply With Quote
Old Apr 3rd, 2002, 11:09 AM   #6
DanExcel
New Member
 
Join Date: Mar 2002
Posts: 29
Default

I am not familiar with them, and I didnt find anything in excel help for "dynamic range" (although I may not know what to look for). Can you direct me to a reference?

Thank you

-DanE
DanExcel is offline   Reply With Quote
Old Apr 3rd, 2002, 11:27 AM   #7
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Here's one...

http://www.cpearson.com/excel/excelF.htm#DynamicRanges

You can also Search this board for a myriad of examples.
Mark W. is offline   Reply With Quote
Old Apr 3rd, 2002, 02:39 PM   #8
DanExcel
New Member
 
Join Date: Mar 2002
Posts: 29
Default

Ah - I didnt realize that the OFFSET function was what you meant by dynamic ranges. I understand this function (I think), however, when I try to use it in the chart dialog box for the X or Y values of a series, it gives an "Invalid Function" error. Can this dynamic range be used in defining a series in the chart dialog box, or does it need to be in VB?

Also, fyi, there is a similar post on dynamic ranges entitled "Charting Ranges" (started by Dazed_). The example formula the post is:

=OFFSET('sheetname'!$B$5,0,0,COUNTA('sheetname'!$B:$B)-1,1)

I'm not sure if it was intended for use in the chart dialog box, tho.

Thank you,

-DanE
DanExcel is offline   Reply With Quote
Old Apr 3rd, 2002, 03:54 PM   #9
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
On 2002-04-03 13:39, DanExcel wrote:
Ah - I didnt realize that the OFFSET function was what you meant by dynamic ranges. I understand this function (I think), however, when I try to use it in the chart dialog box for the X or Y values of a series, it gives an "Invalid Function" error. Can this dynamic range be used in defining a series in the chart dialog box, or does it need to be in VB?

Also, fyi, there is a similar post on dynamic ranges entitled "Charting Ranges" (started by Dazed_). The example formula the post is:

=OFFSET('sheetname'!$B$5,0,0,COUNTA('sheetname'!$B:$B)-1,1)

I'm not sure if it was intended for use in the chart dialog box, tho.

Thank you,

-DanE
You'd create local (sheet) defined names that refer to these offsets and use the defined names in your chart's SERIES functions...

=SERIES(,Sheet1!X_Range,Sheet1!Y_Range,1)

If you data is organized like...

{"X","Y"
;1,10
;2,20
;3,30}

Sheet1!Y_Range could simply refer to...

=OFFSET(Sheet1!X_Range,,1)

If the above sample data is in Sheet1!A1:B4 then Sheet1!X_Range would refer to...

=OFFSET($A$1,,,MATCH(9.99999999999999+E307,$A:$A))

Now, when you add {4,40} to row 5 the chart containing the SERIES function shown above would automatically incorporate the data point, (4,40).

[ This Message was edited by: Mark W. on 2002-04-03 14:57 ]
Mark W. is offline   Reply With Quote
Old Apr 3rd, 2002, 06:09 PM   #10
DanExcel
New Member
 
Join Date: Mar 2002
Posts: 29
Default

Thank you again for your assistance -- I have been lead to another roadblock, however... The COUNTA() function is counting the #N/A cells... So the graph still displays a much larger range than necessary. Is #N/A entered literally as it is? Or is there a special way to enter it?

Thank you,

-DanE
DanExcel is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:37 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes