Forum Discussion
Office 365 Excel - Bar graph and zero values
- Apr 17, 2019
Yes, chart converts empty string ("") to zero. As workaround, in G156:R156 you may use formula like
=IF(ISBLANK(I7),-1E-20,I7)
instead of
=IF(ISBLANK(I7)," ",I7)
and apply to these cells custom format
[<0]"";[>=0]0.0
I assume all your numbers are zero or positive ones.
That returns such cells formating
and the same for the chart
Awesome, thank you! See attached:
We are working with the "3rd Next Appt MASTER" tab. At the bottom of the sheet there is a chart and graph labeled as "Third Next Available Apointment (Days) FY 2019. The chart months in G156:R156 are currently using my old custom formatting of 0.00;-0.00;; because I tried your suggestion without success. These cells are populated from the above monthly charts. If the charts calculated monthly in column "I" or "S" is a number greater than 0.0, it populates the bottom chart and graph correctly: See any month that has a value greater than 0.0. However, Starting in Jan 19, Feb 19 and Mar 19 (S103, I127 and S127) the calculated amounts will be 0.0. Once you insert "0.0" into those cells, the below chart displays the value as it should but it does not graph it as 0.0 (see Mar 19 [S127] as an example). Basically I only want a value to show in the graph when there is a value of 0.0 or greater in the cells G156:R156. If the month is still empty, then no zero or value to show in the graph. I really appreciate you looking at this!
Chris
Yes, chart converts empty string ("") to zero. As workaround, in G156:R156 you may use formula like
=IF(ISBLANK(I7),-1E-20,I7)
instead of
=IF(ISBLANK(I7)," ",I7)
and apply to these cells custom format
[<0]"";[>=0]0.0
I assume all your numbers are zero or positive ones.
That returns such cells formating
and the same for the chart
- SergeiBaklanApr 19, 2019Diamond Contributor
Yukontornado69 , thank you. But that's not the universal solution, just workaround for this concrete case. For another data that could be something else.
- Yukontornado69Apr 19, 2019Copper Contributor
Sergei,
That is a very interesting way to solve this problem! Meaning that I would have NEVER gotten to that answer, lol. I would have danced around a solution for a very long time. I appreciate your skills and I hope that I can reach out to you in the future to steal more of your knowledge!
- SergeiBaklanApr 18, 2019Diamond Contributor
Hi Chris,
These cells are not blanks or numbers, values into them are returned by formula. Formula in your variant returns some positive number or text (actually space or empty string). Within the chart empty strings are interpreted as zeroes when we apply number formats. The idea for the workaround is to have numbers only. Instead of empty string formula returns quite small negative number (1e-20 in this case) which from visualization point of view is equivalent of nothing.
After that we apply custom number format which for negative numbers shows empty string, for positive ones applies desired number format. I assume here what you don't have real negative numbers in data set.
- Yukontornado69Apr 18, 2019Copper Contributor
Sergei,
Ok, wow that worked perfectly! I understand how the custom formatting change reads and works. However, could you school me a little bit on how your new formula works in the cells G156:R156 please? I am not sure what the "-1E-20" is doing or how it works that replaces the show blank "".
Thank you in advance,
Chris