[dba-Tech] Excel magic - automating chart data range creation

Tina Norris Fields tinanfields at torchlake.com
Thu Sep 18 08:12:04 CDT 2003


Hi,

I have a client who takes voltage readings along pipelines and cables to 
monitor their health and performance.  The data they get back gives them 
the station reading (feet), the position (GPS), and a voltage reading. 
 The voltage is a sort of "response" voltage triggered by a sending 
device, which may be "on" or "off" depending on where in the cycle it 
is, and cycles may be of many different lengths, but should all be 
factors of 60 (as in seconcds per minute).

The first need they had was to separate the readings into their "on" or 
"off" state.  I worked out a user form to request the length of the 
cycle and whether the cycle started in "on" mode or in "off" mode.  This 
information allowed me to build a lookup table and grab the readings 
from the combined column and put them in their appropriate columns.  

The next need was to chart the readings as curves on the same graph, 
leaving out the zero readings (interpolating the nulls in the curve). 
 The data can come from many thousands of feet of readings.  The charts 
should show readings for 1,000 feet per chart page.  I have figured out 
how to get the total value of station readings and do a an integer 
division and a modulus division to determine how many pages of charts I 
need.  Here's the part I haven't worked out:

How do I code my VB to step through the station readings until it comes 
to the correct number for establishing the final reading in the range 
for the first chart?  I keep thinking this should be easy, but I'm not 
getting it.

Say, for example, my readings run from 1200 ft to 3700 ft.  Clearly, I 
will need  3 charts.  Okay, starting with the cell reading 1200, I need 
to step down the column until I find the cell reading 2200 
approximately.  (I've decided to make my 1,000 feet inclusive - so the 
last reading on chart 1 will be the first reading on chart 2.)  

Any ideas?  Do I need to dynamically create another vertical lookup 
table?  I would appreciate any thoughts on this.

Thanks,
Tina



More information about the dba-Tech mailing list