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.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
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)),"")
 
Upvote 0
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.
 
Upvote 0
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:
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,309
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top