I need to make a simple XY chart out of 2 columns. This is of course obvious but in my case, the data at taken from another sheet.
The values in the X series are simply copied from another sheet "Sheet2". I could possibly simply recall those values by using the obvious formula
= Sheet2!A1
but since these values are in the Date format, there are some issues. In cases where the cell A1 in Sheet2 is indeed blank - and there are such cases - the above formula would by default yield a zero value, which for the date format provides January 1st, 1904. In order to ensure that blank cells in Sheet2 are left blank in my current page, I have thus used
= IF(NB(Sheet2!A1)=1;Sheet2!A1;"")
(that is, if there is a value in that cell, it provides that value, but leaves the cell blank if there is no value).
Fine, this is my column A, corresponding to the X values in my desired XY chart.
Then, the B column simply numbers the dates in column A from the oldest to the most recent:
the corresponding B1 cell would thus have the formula
= IF(NB(A1)=1; RANK(A1;A$1:A$100;1); "")
(Again, if there is no value in the nearby cell A1, it gives a blank result, and otherwise provides the rank of that date with respect to the whole column (here assumed to go from A1 to A100).
To summarize, by columns A and B look like this:
A B
1 = IF(NB(Sheet2!A1)=1;Sheet2!A1;"") = IF(NB(A1)=1; RANK(A1;A$1:A$100;1); "")
2 = IF(NB(Sheet2!A2)=1;Sheet2!A2;"") = IF(NB(A2)=1; RANK(A2;A$1:A$100;1); "")
3 = IF(NB(Sheet2!A3)=1;Sheet2!A3;"") = IF(NB(A3)=1; RANK(A3;A$1:A$100;1); "")
4 = IF(NB(Sheet2!A4)=1;Sheet2!A4;"") = IF(NB(A4)=1; RANK(A4;A$1:A$100;1); "")
5 = IF(NB(Sheet2!A5)=1;Sheet2!A5;"") = IF(NB(A5)=1; RANK(A5;A$1:A$100;1); "")
6 = IF(NB(Sheet2!A6)=1;Sheet2!A6;"") = IF(NB(A6)=1; RANK(A6;A$1:A$100;1); "")
Now if we assume that Sheet2 contains the following data:
A
1 12.10.2008
2 01.01.2006
3
4 07.06.2004
5
6 12.03.2007
Then the current sheet yields the following columns A and B:
A B
1 12.10.2008 4
2 01.01.2006 2
3
4 07.06.2004 1
5
6 12.03.2007 3
All I want next is to make an XY plot of that column B as a function of the column A. But it doesn't work! It provides the right chart only if I select a range of data with no blank line (e.g. if I select only the first 2 lines in the above example). Otherwise it doesn't understand that it needs to list the B values as a function of the A values, and I get an ugly scattered plot.
I realize this may seem long and hard to understand, but maybe somebody can help?
Or if you have another idea on how to avoid the "zero" date value "01.01.1904" when Sheet2 contains blank cells, that could be useful...
THanks!
Bookmarks