How to hide zero values in Excel grouped bar chart?
Assume the following data:
X | A | B | C | D | E | F
Group 1 | 1 | 0 | 0 | 2 | 0 | 0
Group 2 | 0 | 0 | 3 | 0 | 1 | 0
Group 3 | 0 | 1 | 0 | 0 | 0 | 2
Basically I measured 6 elements A to F, so I have 6 values. They belong to 3 different types, so I created 3 groups.
I would like to use a grouped bar chart so that I have only 6 bars, grouped by the groups. So in theory, one would see the data in following order: A D C E B F, where A and D belong together, C and E, and so on:
I managed to do this partially with a bar chart, but Excel shows A to F for all groups (the zero-valued elements are shown too). Hence, I now see 18 bars with 12 (zero) gaps: A B C D E F A B C ... F. Also, with my approach there is no gap between the groups.
How can I achieve a grouped chart that only shows the non-zero values? I would not mind using another strategy, if there is. Or even a VB script.
So far I found that Pivot charts come closest to what I tried. But I did not manage to get a spacing between the groups yet.
microsoft-excel
add a comment |
Assume the following data:
X | A | B | C | D | E | F
Group 1 | 1 | 0 | 0 | 2 | 0 | 0
Group 2 | 0 | 0 | 3 | 0 | 1 | 0
Group 3 | 0 | 1 | 0 | 0 | 0 | 2
Basically I measured 6 elements A to F, so I have 6 values. They belong to 3 different types, so I created 3 groups.
I would like to use a grouped bar chart so that I have only 6 bars, grouped by the groups. So in theory, one would see the data in following order: A D C E B F, where A and D belong together, C and E, and so on:
I managed to do this partially with a bar chart, but Excel shows A to F for all groups (the zero-valued elements are shown too). Hence, I now see 18 bars with 12 (zero) gaps: A B C D E F A B C ... F. Also, with my approach there is no gap between the groups.
How can I achieve a grouped chart that only shows the non-zero values? I would not mind using another strategy, if there is. Or even a VB script.
So far I found that Pivot charts come closest to what I tried. But I did not manage to get a spacing between the groups yet.
microsoft-excel
1
Can you post a screenshot of what you're getting, and maybe mock up an image of what you want (or draw it in crayon on a napkin and snap a picture with your cellphone)? The title and body of the question seem to describe different things, so it isn't clear exactly what the problem is.
– fixer1234
Dec 30 '18 at 1:19
The most easiest should File,, Option,,, Advanced,, find Display Option For Worksheet,, then un-check Show a zero in cell that has Zero value and after make the Graph,, since Graph reads data from the source.
– Rajesh S
Dec 30 '18 at 7:18
@fixer1234 I made a sketch of the desired output and added some comments.
– andreas
Jan 2 at 15:00
@RajeshS unfortunately, this does not work. It does only hide the values from the cells but not from the charts?
– andreas
Jan 2 at 15:00
add a comment |
Assume the following data:
X | A | B | C | D | E | F
Group 1 | 1 | 0 | 0 | 2 | 0 | 0
Group 2 | 0 | 0 | 3 | 0 | 1 | 0
Group 3 | 0 | 1 | 0 | 0 | 0 | 2
Basically I measured 6 elements A to F, so I have 6 values. They belong to 3 different types, so I created 3 groups.
I would like to use a grouped bar chart so that I have only 6 bars, grouped by the groups. So in theory, one would see the data in following order: A D C E B F, where A and D belong together, C and E, and so on:
I managed to do this partially with a bar chart, but Excel shows A to F for all groups (the zero-valued elements are shown too). Hence, I now see 18 bars with 12 (zero) gaps: A B C D E F A B C ... F. Also, with my approach there is no gap between the groups.
How can I achieve a grouped chart that only shows the non-zero values? I would not mind using another strategy, if there is. Or even a VB script.
So far I found that Pivot charts come closest to what I tried. But I did not manage to get a spacing between the groups yet.
microsoft-excel
Assume the following data:
X | A | B | C | D | E | F
Group 1 | 1 | 0 | 0 | 2 | 0 | 0
Group 2 | 0 | 0 | 3 | 0 | 1 | 0
Group 3 | 0 | 1 | 0 | 0 | 0 | 2
Basically I measured 6 elements A to F, so I have 6 values. They belong to 3 different types, so I created 3 groups.
I would like to use a grouped bar chart so that I have only 6 bars, grouped by the groups. So in theory, one would see the data in following order: A D C E B F, where A and D belong together, C and E, and so on:
I managed to do this partially with a bar chart, but Excel shows A to F for all groups (the zero-valued elements are shown too). Hence, I now see 18 bars with 12 (zero) gaps: A B C D E F A B C ... F. Also, with my approach there is no gap between the groups.
How can I achieve a grouped chart that only shows the non-zero values? I would not mind using another strategy, if there is. Or even a VB script.
So far I found that Pivot charts come closest to what I tried. But I did not manage to get a spacing between the groups yet.
microsoft-excel
microsoft-excel
edited Jan 2 at 14:59
andreas
asked Dec 29 '18 at 15:19
andreasandreas
202127
202127
1
Can you post a screenshot of what you're getting, and maybe mock up an image of what you want (or draw it in crayon on a napkin and snap a picture with your cellphone)? The title and body of the question seem to describe different things, so it isn't clear exactly what the problem is.
– fixer1234
Dec 30 '18 at 1:19
The most easiest should File,, Option,,, Advanced,, find Display Option For Worksheet,, then un-check Show a zero in cell that has Zero value and after make the Graph,, since Graph reads data from the source.
– Rajesh S
Dec 30 '18 at 7:18
@fixer1234 I made a sketch of the desired output and added some comments.
– andreas
Jan 2 at 15:00
@RajeshS unfortunately, this does not work. It does only hide the values from the cells but not from the charts?
– andreas
Jan 2 at 15:00
add a comment |
1
Can you post a screenshot of what you're getting, and maybe mock up an image of what you want (or draw it in crayon on a napkin and snap a picture with your cellphone)? The title and body of the question seem to describe different things, so it isn't clear exactly what the problem is.
– fixer1234
Dec 30 '18 at 1:19
The most easiest should File,, Option,,, Advanced,, find Display Option For Worksheet,, then un-check Show a zero in cell that has Zero value and after make the Graph,, since Graph reads data from the source.
– Rajesh S
Dec 30 '18 at 7:18
@fixer1234 I made a sketch of the desired output and added some comments.
– andreas
Jan 2 at 15:00
@RajeshS unfortunately, this does not work. It does only hide the values from the cells but not from the charts?
– andreas
Jan 2 at 15:00
1
1
Can you post a screenshot of what you're getting, and maybe mock up an image of what you want (or draw it in crayon on a napkin and snap a picture with your cellphone)? The title and body of the question seem to describe different things, so it isn't clear exactly what the problem is.
– fixer1234
Dec 30 '18 at 1:19
Can you post a screenshot of what you're getting, and maybe mock up an image of what you want (or draw it in crayon on a napkin and snap a picture with your cellphone)? The title and body of the question seem to describe different things, so it isn't clear exactly what the problem is.
– fixer1234
Dec 30 '18 at 1:19
The most easiest should File,, Option,,, Advanced,, find Display Option For Worksheet,, then un-check Show a zero in cell that has Zero value and after make the Graph,, since Graph reads data from the source.
– Rajesh S
Dec 30 '18 at 7:18
The most easiest should File,, Option,,, Advanced,, find Display Option For Worksheet,, then un-check Show a zero in cell that has Zero value and after make the Graph,, since Graph reads data from the source.
– Rajesh S
Dec 30 '18 at 7:18
@fixer1234 I made a sketch of the desired output and added some comments.
– andreas
Jan 2 at 15:00
@fixer1234 I made a sketch of the desired output and added some comments.
– andreas
Jan 2 at 15:00
@RajeshS unfortunately, this does not work. It does only hide the values from the cells but not from the charts?
– andreas
Jan 2 at 15:00
@RajeshS unfortunately, this does not work. It does only hide the values from the cells but not from the charts?
– andreas
Jan 2 at 15:00
add a comment |
1 Answer
1
active
oldest
votes
So in theory, one would see the data in following order: A D C E B F
Generate the 'sorted' table 1st.. then only draw the bar chart.
TLDR : draw bar chart from this (generated) table
| F | B | E | C | D | A
Group 1 | | | | | 2 | 1
Group 2 | | | 1 | 3 | |
Group 3 | 2 | 1 | | | |
Step-by-step
- clean the table. make all '0' become "".
- get the column number for non '0' entry.
- rank the number in step 2, divide by 10, then add the row number as integer.
- rank generated step 3 numbers to get 1,2,3,4..
- generate new table (part 1 of 2) from sorted "step 4" numbers
- generate new table (part 2 of 2) using index match from "step 5" numbers
- draw the bar graph from the new table.
assuming B1 is the "X" and H4 is the final data from OP's table, these are the detail step :
type in :
A6 ----> cleaned
A11 ----> column
A15 ----> rank1
A19 ----> rank2
A24 ----> generate new table
A28 ----> generate final table
Step 1 work :
C6 ----> =C1
and drag until H6, then
C7 ----> =IF(C2=0,"",C2)
and drag until H9. Then for Step 2 :
C11 ----> =IF(C7="","",COLUMN(C7))
and drag until H13. Then for Step 3 :
C15 ----> =IFERROR(ROW(C11)+RANK(C11,$C11:$H11,1)/10,"")
and drag until H17. For Step 4 :
C19 ----> =IFERROR(RANK(C15,$C$15:$H$17,0),"")
and drag until H21, then for Step 5 :
C23 ----> =B23+1
and drag until H23, then
C25 ----> =IFERROR(MATCH(C$23,$C19:$H19,0),"")
and drag until H27, then finally :
B30 ----> =B7
and drag until F32, then
C29 ----> =INDEX($C6:$H6,1,MAX(C$25:C$27))
and drag until H29, then
C30 ----> =IFERROR(INDEX($C7:$H7,1,C25),"")
and drag until H32.
Use B29:H32 table to generate your bar graph.
Hope it helps. ( :
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388758%2fhow-to-hide-zero-values-in-excel-grouped-bar-chart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
So in theory, one would see the data in following order: A D C E B F
Generate the 'sorted' table 1st.. then only draw the bar chart.
TLDR : draw bar chart from this (generated) table
| F | B | E | C | D | A
Group 1 | | | | | 2 | 1
Group 2 | | | 1 | 3 | |
Group 3 | 2 | 1 | | | |
Step-by-step
- clean the table. make all '0' become "".
- get the column number for non '0' entry.
- rank the number in step 2, divide by 10, then add the row number as integer.
- rank generated step 3 numbers to get 1,2,3,4..
- generate new table (part 1 of 2) from sorted "step 4" numbers
- generate new table (part 2 of 2) using index match from "step 5" numbers
- draw the bar graph from the new table.
assuming B1 is the "X" and H4 is the final data from OP's table, these are the detail step :
type in :
A6 ----> cleaned
A11 ----> column
A15 ----> rank1
A19 ----> rank2
A24 ----> generate new table
A28 ----> generate final table
Step 1 work :
C6 ----> =C1
and drag until H6, then
C7 ----> =IF(C2=0,"",C2)
and drag until H9. Then for Step 2 :
C11 ----> =IF(C7="","",COLUMN(C7))
and drag until H13. Then for Step 3 :
C15 ----> =IFERROR(ROW(C11)+RANK(C11,$C11:$H11,1)/10,"")
and drag until H17. For Step 4 :
C19 ----> =IFERROR(RANK(C15,$C$15:$H$17,0),"")
and drag until H21, then for Step 5 :
C23 ----> =B23+1
and drag until H23, then
C25 ----> =IFERROR(MATCH(C$23,$C19:$H19,0),"")
and drag until H27, then finally :
B30 ----> =B7
and drag until F32, then
C29 ----> =INDEX($C6:$H6,1,MAX(C$25:C$27))
and drag until H29, then
C30 ----> =IFERROR(INDEX($C7:$H7,1,C25),"")
and drag until H32.
Use B29:H32 table to generate your bar graph.
Hope it helps. ( :
add a comment |
So in theory, one would see the data in following order: A D C E B F
Generate the 'sorted' table 1st.. then only draw the bar chart.
TLDR : draw bar chart from this (generated) table
| F | B | E | C | D | A
Group 1 | | | | | 2 | 1
Group 2 | | | 1 | 3 | |
Group 3 | 2 | 1 | | | |
Step-by-step
- clean the table. make all '0' become "".
- get the column number for non '0' entry.
- rank the number in step 2, divide by 10, then add the row number as integer.
- rank generated step 3 numbers to get 1,2,3,4..
- generate new table (part 1 of 2) from sorted "step 4" numbers
- generate new table (part 2 of 2) using index match from "step 5" numbers
- draw the bar graph from the new table.
assuming B1 is the "X" and H4 is the final data from OP's table, these are the detail step :
type in :
A6 ----> cleaned
A11 ----> column
A15 ----> rank1
A19 ----> rank2
A24 ----> generate new table
A28 ----> generate final table
Step 1 work :
C6 ----> =C1
and drag until H6, then
C7 ----> =IF(C2=0,"",C2)
and drag until H9. Then for Step 2 :
C11 ----> =IF(C7="","",COLUMN(C7))
and drag until H13. Then for Step 3 :
C15 ----> =IFERROR(ROW(C11)+RANK(C11,$C11:$H11,1)/10,"")
and drag until H17. For Step 4 :
C19 ----> =IFERROR(RANK(C15,$C$15:$H$17,0),"")
and drag until H21, then for Step 5 :
C23 ----> =B23+1
and drag until H23, then
C25 ----> =IFERROR(MATCH(C$23,$C19:$H19,0),"")
and drag until H27, then finally :
B30 ----> =B7
and drag until F32, then
C29 ----> =INDEX($C6:$H6,1,MAX(C$25:C$27))
and drag until H29, then
C30 ----> =IFERROR(INDEX($C7:$H7,1,C25),"")
and drag until H32.
Use B29:H32 table to generate your bar graph.
Hope it helps. ( :
add a comment |
So in theory, one would see the data in following order: A D C E B F
Generate the 'sorted' table 1st.. then only draw the bar chart.
TLDR : draw bar chart from this (generated) table
| F | B | E | C | D | A
Group 1 | | | | | 2 | 1
Group 2 | | | 1 | 3 | |
Group 3 | 2 | 1 | | | |
Step-by-step
- clean the table. make all '0' become "".
- get the column number for non '0' entry.
- rank the number in step 2, divide by 10, then add the row number as integer.
- rank generated step 3 numbers to get 1,2,3,4..
- generate new table (part 1 of 2) from sorted "step 4" numbers
- generate new table (part 2 of 2) using index match from "step 5" numbers
- draw the bar graph from the new table.
assuming B1 is the "X" and H4 is the final data from OP's table, these are the detail step :
type in :
A6 ----> cleaned
A11 ----> column
A15 ----> rank1
A19 ----> rank2
A24 ----> generate new table
A28 ----> generate final table
Step 1 work :
C6 ----> =C1
and drag until H6, then
C7 ----> =IF(C2=0,"",C2)
and drag until H9. Then for Step 2 :
C11 ----> =IF(C7="","",COLUMN(C7))
and drag until H13. Then for Step 3 :
C15 ----> =IFERROR(ROW(C11)+RANK(C11,$C11:$H11,1)/10,"")
and drag until H17. For Step 4 :
C19 ----> =IFERROR(RANK(C15,$C$15:$H$17,0),"")
and drag until H21, then for Step 5 :
C23 ----> =B23+1
and drag until H23, then
C25 ----> =IFERROR(MATCH(C$23,$C19:$H19,0),"")
and drag until H27, then finally :
B30 ----> =B7
and drag until F32, then
C29 ----> =INDEX($C6:$H6,1,MAX(C$25:C$27))
and drag until H29, then
C30 ----> =IFERROR(INDEX($C7:$H7,1,C25),"")
and drag until H32.
Use B29:H32 table to generate your bar graph.
Hope it helps. ( :
So in theory, one would see the data in following order: A D C E B F
Generate the 'sorted' table 1st.. then only draw the bar chart.
TLDR : draw bar chart from this (generated) table
| F | B | E | C | D | A
Group 1 | | | | | 2 | 1
Group 2 | | | 1 | 3 | |
Group 3 | 2 | 1 | | | |
Step-by-step
- clean the table. make all '0' become "".
- get the column number for non '0' entry.
- rank the number in step 2, divide by 10, then add the row number as integer.
- rank generated step 3 numbers to get 1,2,3,4..
- generate new table (part 1 of 2) from sorted "step 4" numbers
- generate new table (part 2 of 2) using index match from "step 5" numbers
- draw the bar graph from the new table.
assuming B1 is the "X" and H4 is the final data from OP's table, these are the detail step :
type in :
A6 ----> cleaned
A11 ----> column
A15 ----> rank1
A19 ----> rank2
A24 ----> generate new table
A28 ----> generate final table
Step 1 work :
C6 ----> =C1
and drag until H6, then
C7 ----> =IF(C2=0,"",C2)
and drag until H9. Then for Step 2 :
C11 ----> =IF(C7="","",COLUMN(C7))
and drag until H13. Then for Step 3 :
C15 ----> =IFERROR(ROW(C11)+RANK(C11,$C11:$H11,1)/10,"")
and drag until H17. For Step 4 :
C19 ----> =IFERROR(RANK(C15,$C$15:$H$17,0),"")
and drag until H21, then for Step 5 :
C23 ----> =B23+1
and drag until H23, then
C25 ----> =IFERROR(MATCH(C$23,$C19:$H19,0),"")
and drag until H27, then finally :
B30 ----> =B7
and drag until F32, then
C29 ----> =INDEX($C6:$H6,1,MAX(C$25:C$27))
and drag until H29, then
C30 ----> =IFERROR(INDEX($C7:$H7,1,C25),"")
and drag until H32.
Use B29:H32 table to generate your bar graph.
Hope it helps. ( :
edited Jan 3 at 3:51
answered Jan 2 at 8:53
p._phidot_p._phidot_
57429
57429
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388758%2fhow-to-hide-zero-values-in-excel-grouped-bar-chart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you post a screenshot of what you're getting, and maybe mock up an image of what you want (or draw it in crayon on a napkin and snap a picture with your cellphone)? The title and body of the question seem to describe different things, so it isn't clear exactly what the problem is.
– fixer1234
Dec 30 '18 at 1:19
The most easiest should File,, Option,,, Advanced,, find Display Option For Worksheet,, then un-check Show a zero in cell that has Zero value and after make the Graph,, since Graph reads data from the source.
– Rajesh S
Dec 30 '18 at 7:18
@fixer1234 I made a sketch of the desired output and added some comments.
– andreas
Jan 2 at 15:00
@RajeshS unfortunately, this does not work. It does only hide the values from the cells but not from the charts?
– andreas
Jan 2 at 15:00