Ah, it's a lost cause. Those who want XL to treat log(0) as zero will
probably never change their opinion. Of course, I suspect that if XL
ever did implement that 'feature,' some in the same crowd -- or in some
other crowd -- would be falling over each other trying to be the first
and the loudest to point out that MS can't get basic math right.
One very straightforward option is to transform the data and then plot
on a 'normal' y-axis. Now, zeros can be handled as one sees fit and
non-zero values would be mapped to log().
But, even if one insists on plotting the data set and setting the y-
axis to a log scale...
Just redefine 0=1 and the data will plot with log(0)=log(1)=0. Or if
one wants to interpolate over the zeros, use NA().
It's *so* simple with defined formulas. Below are *four* different
ways to get XL to 'handle' zeros in a log scale plot.
DataSet =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)
DatasetSansZeros =IF(DataSet<>0,DataSet)
The first name defines the dataset. I chose a dynamic definition so
that the graph adjusts as one adds/subtracts data at the *bottom* of
the existing data set.
The 2nd is a work name that simplifies some downstream formulae.
ZerosAsNAs =IF(DataSet=0,NA(),DataSet)
ZerosAsOnes =IF(DataSet=0,1,DataSet)
ZerosAsSmallestDiv2 =IF(DataSet=0,MIN(DatasetSansZeros)/2,DataSet)
ZeroSpikes =IF(DataSet=0,MIN(DatasetSansZeros)/10,NA())
The first two should be self evident. The third, ZerosAsSmallestDiv2
plots zeros as the smallest non-zero value divided by 2. Obviously,
one can pick any desired value.
Now, plot either ZerosAsNAs, ZerosAsOnes, or ZerosAsSmallestDiv2 as the
y-values with the y-axis set to a log scale. For more on how to use
names in chart see Names in Charts (
http://www.tushar-
mehta.com/excel/newsgroups/dynamic_charts/names_in_charts.html)
ZeroSpikes plots *only* zero values and should be used in conjunction
with one of the other three. Effectively, it 'highlights' the zeros.
This series should be plotted with a marker and no line. A variant
would be to replace the MIN()/10 with 1.
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions