View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default data range referrences

Make your life simple. Suppose your dates are in column A, from A2 (Feb 1)
to A30 (Feb 29). Put this formula into cell A30:

=IF(MONTH(A29+1)=2,A29+1,NA())

This puts Feb 29 into the cell on a leap year, or #N/A otherwise. The #N/A
will not be plotted in an XY chart or a line chart, and the data will
progress in one step from 2/28 to 3/1 on non-leap years.

- Jon
-------
Jon Peltier, Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/

Advanced Excel Conference - June 17-18 2009 - Charting and Programming
http://peltiertech.com/Training/2009...00906ACNJ.html
_______


"FatBytestard" wrote in message
...
On Sun, 24 May 2009 08:43:26 -0400, "Jon Peltier"
wrote:

I guess I don't understand what you're trying to do, and how you're going
about it.


I developed a workbook which contains 12 month 'tables' (worksheets)
that allow two patient test data entries per day.

There are 12 monthly charts that track the test results. I also have
one 365 day chart.

My February month is 29 rows on a leap year, but only 28 otherwise.

The chart will have an error as will the year unless I handle leap
years (or non-leap years) such that the monthly chart and yearly chart
track correctly, according to the row count on the February sheet.

I was thinking of simply making a duplicate "table" a few rows below
the current table, and remove the 29th line from one, and have the use
apply test data to the right one, or run a macro to hide one table.

It still need two charts (three counting the additional annum chart)
for February to keep the error out, so I was wanting to dynamically
declare the chart spec. It appears I may be able to one axis at a time,
just not the data block itself, which is what I was trying to point at.

So, I thought I wanted a test for leap year, and would likely have to
develop a little engine to give the user the access to the right one
only, and the right chart(s) would get declared, or referred to.

So, my other solution was simply to make two tables on the same sheet,
and two charts on the same chart sheet (February), and make a little test
to hide the appropriate ones.

That was as opposed to dynamically declaring things after testing for
the leap year "flag setting".

Anyway, my first page has the Year, name (patient), date, and set
points for the tables to show red values at, and the doctor phone number.
That data gets referred to on each sheet and the month's date column
fills in the day of the week based on the year selected. Those
selections do cause date entries to transit from 2/28/xxxx to 3/1/xxxx
correctly on non-leap years, and also on leap years after passing
2/29/xxxx, so I could test for that somewhere. Otherwise it screws up my
Feruary sheet. :-)

Not sure if I related this very well.