Exclude #N/A values from stacked column chart

rg144

New Member
Joined
Jul 22, 2012
Messages
4
Hi guys,

Im trying to create a stacked column chart that only shows rows with values and excludes rows with #N/A values.

NOTES:
1. I can't filter as I have 2 columns I wish to display in the stacked chart, and sometimes a #N/A value in column B does not equal #N/A in column C..
2. I can't hide rows as each cell is dynamic (values are generated using COUNTIFS formulas).


Expiry_DateTransport_By_ShipTransport_By_Air
19/07/2012#N/A13
20/07/2012115
21/07/2012#N/A10
22/07/2012#N/A14
23/07/2012#N/A#N/A
24/07/2012217
25/07/2012115
26/07/2012#N/A#N/A
27/07/20121#N/A
28/07/2012#N/A7
29/07/201221

<tbody>
</tbody>

In the example above- currently my stacked column graph charts all days.

In the example above- I don't want the bolded rows (23/07 and 26/07) to be charted (meaning i want to remove the empty space in the outputted chart)

I've searched the net tirelessly and cannot find an answer :(

Any help would be much appreciated guys.

Kind Regards.
 

Skybluekid

Well-known Member
Joined
Apr 17, 2012
Messages
828
Try putting =IFERROR(IF(COUNTIFS(DATA!B:B,CHART!A2,DATA!C:C,CHART!$B$1,DATA!A:A,$F$5)=0,NA(),COUNTIFS(DATA!B:B,CHART!A2,DATA!C:C,CHART!$B$1,DATA!A:A,$F$5)),"")
 

CAPtain232

Board Regular
Joined
Oct 13, 2011
Messages
197
The iferror function will only make a cell read whatever you want it to read, but it will not delete the row all together....I would assume, as I am still learning myself, that this would have to be done with code and not a simple formula. Hopefully someone will chime in.
 

rg144

New Member
Joined
Jul 22, 2012
Messages
4
Try putting =IFERROR(IF(COUNTIFS(DATA!B:B,CHART!A2,DATA!C:C,CHART!$B$1,DATA!A:A,$F$5)=0,NA(),COUNTIFS(DATA!B:B,CHART!A2,DATA!C:C,CHART!$B$1,DATA!A:A,$F$5)),"")
Skyblue, thanks for your prompt reply.

I tried that previously, it does remove #N/A values from the cells and 'clears' them (if there's an excel error), however I still have blanks (gaps) in my chart as shown below..




basically I want the x-axis (date) to dynamically (automatically) remove dates that have no values.. i hope im making sense ;)
 
Last edited:

Skybluekid

Well-known Member
Joined
Apr 17, 2012
Messages
828
In F7 =IFERROR(INDEX($A$2:$A$40,AGGREGATE(15,6,(ROW($A$2:$A$40)-ROW($A$2)+1/($B$2:$B$40>0)*($
C$2:$C$40>0)),ROWS(G$46:G46))),"") and drag down to F47 -- This will give you the dates with no gaps

In G7 =IFERROR(INDEX($B$2:$B$40,MATCH(F7,$A$2:$A$40,0)),"") drag down to G47
In H7 =IFERROR(INDEX($C$2:$C$40,MATCH(F7,$A$2:$A$40,0)),"") drag down to H47

Create your chart from F7 to H47
 

Forum statistics

Threads
1,081,518
Messages
5,359,244
Members
400,523
Latest member
ExcelNewbie98

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top