+ Reply to Thread
Results 1 to 8 of 8

Function that allows to plot graphs without 0s or N/A showing

  1. #1
    Registered User
    Join Date
    07-07-2015
    Location
    England
    MS-Off Ver
    MS Office 2010
    Posts
    69

    Function that allows to plot graphs without 0s or N/A showing

    Hi,

    I have two functionss:

    [CODE]$AD$2:$AD$10000,MATCH($B6&"-"&F$4,'171004.xlsx]export'!$C$2:$C$10000&"-"&'171004.xlsx]export'!$AB$2:$AB$10000, 0)),NA())/CODE]

    Using the NA() at the end allows me to plot the graph with the NA()'s showing up as 0s. However if I try and find out the Max, Min, Average etc. of the range it results in #N/A.

    The second funtions:

    [CODE][/$AD$2:$AD$10000,MATCH($B6&"-"&F$4,'171004.xlsx]export'!$C$2:$C$10000&"-"&'171004.xlsx]export'!$AB$2:$AB$10000, 0)), "")CODE]

    Using the "" allows me to return a value for Max, Min, Average etc. but the issues is when plotting the graph, those blank values show up as 0.

    What's the best function to use?
    Last edited by hassanm; 10-05-2017 at 02:11 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to solve two problems

    Unfortunately your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: How to solve two problems

    You are very close with the code tags,
    Your closed tag should be after the code
    [/code]
    Please Login or Register  to view this content.
    Last edited by davesexcel; 10-05-2017 at 01:15 PM.

  4. #4
    Registered User
    Join Date
    07-07-2015
    Location
    England
    MS-Off Ver
    MS Office 2010
    Posts
    69
    Quote Originally Posted by Richard Buttrey View Post
    Unfortunately your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Apologies, I have adjusted the title.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Function that allows to plot graphs without 0s or N/A showing

    Would you upload the workbook so that we can see the problem in context.

  6. #6
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Function that allows to plot graphs without 0s or N/A showing

    Generally speaking (since we dont have a sample)...

    If the question is how do you omit (aka not plot) null records as plot points in your chart, then it depends on your definition of a null value. If you can make the records you want to omit 0 or empty then there is an option built into the chart itself for how to treat them. If you open the select data dialog on the chart there is a button for "hidden and empty cells". You can treat an empty cell as a 0, a gap, or in some chart types connect data points with a line (like in a line chart).

    By extension of the above dialog, it is inferred that the default is to also not include hidden cells in a chart. So you could with some arrangements also hide the rows/columns that you do not want to include in the chart so they are not plotted.

    If the version of Excel in your profile thing isnt correct, Excel 2013+ also have built in filters to filter out data points from the chart (3 buttons to the right of a chart when its selected).

    Otherwise your best bet is to setup a second table that either statically or dynamically has just the data you want and base the chart on that.

    If I am mistaken and you simply do not want to show the label of 0 in your graph but still want the plot point there, then you can use number formatting on the labels to simply not show 0. Just format the labels number format using a custom format to something like:

    General;-General;

    Replace General and -General with whatever formats you prefer. In the above the first entry prior to the semi colon is how to represent a positive numeric value. The entry between the 1st and 2nd semi colon is how to represent a negative number. The entry (empty) after the second semi colon is what to do if the value is 0...and since its empty it displays nothing for 0 instead of 0.

    Without an example I am afraid thats the most helpful I may be.

  7. #7
    Registered User
    Join Date
    07-07-2015
    Location
    England
    MS-Off Ver
    MS Office 2010
    Posts
    69

    Re: Function that allows to plot graphs without 0s or N/A showing

    Hi,

    Please find the sheet attached. I have highlighted the cells with the different functions.

    Cell E14 has the function:
    Please Login or Register  to view this content.
    This comes back with a blank cell but it plots the data point as 0 as shown in the graph. If I use this function throughout I am able to calculate the max, averages, min etc. but the graph will give me data points I do not want.

    Cell E15 has the function:
    Please Login or Register  to view this content.
    This comes back with #N/A and will not show up in the graph as shown. However, as can be seen in cell E28:30 this results in the Max, Average and Min being #N/A.

    I would like to have one function that enables me to plot the graph and use other functions for analysis.

    Hope that helps and is clear.

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Function that allows to plot graphs without 0s or N/A showing

    I don't think you are going to find an easy way for a single function/column to do both. This should be an interesting read: https://peltiertech.com/mind-the-gap...g-empty-cells/

    IMO, the easiest way (even if it seems inefficient) is to have two columns. One column with your first formula (that returns a string on error) that you will use to compute min, max, etc. with formulas that readily ignore text values. A second column with your second formula (that returns NA) that you will use for the chart, which readily ignores N/A errors. If you are worried about the duplicated effort, then make the first column a simple function of the second column =IFERROR(F5,"") where F5 has =IFERROR(INDEX(Data!G12:G304,MATCH($B15&"-"&E$3,Data!A12:A304&"-"&Data!F12:F304, 0)),NA()).

    If you are absolutely opposed to using two columns, then I would suggest that you will need to use the NA() version of the formula, then program your MAX(), MIN() etc. functions to correctly handle the error values. Maybe something like =MAX(IFERROR(E5:E26,"")) entered as an array function (ctrl-shift-enter).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. Replies: 1
    Last Post: 05-27-2016, 02:39 AM
  2. What business problems do you solve using macros?
    By sergey_z in forum The Water Cooler
    Replies: 4
    Last Post: 11-21-2015, 11:59 AM
  3. Can anyone help me solve these problems?
    By Jim9600 in forum Excel General
    Replies: 3
    Last Post: 10-29-2014, 07:09 PM
  4. [SOLVED] Need help for IF Function to solve my excel problems
    By G_A_S in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-09-2013, 02:48 AM
  5. Hear to learn VBA mysteries and solve some problems
    By Denison in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-30-2013, 05:51 AM
  6. Replies: 3
    Last Post: 09-09-2012, 10:45 AM
  7. solve Sorting problems...
    By Gunnett in forum Excel General
    Replies: 2
    Last Post: 06-28-2007, 03:17 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