T E Schmitz wrote:
>
> I have a spreadsheet with 3 columns (DATE, HIGH, LOW).
>
> For each row I want to search the LOW column upwards in order to find
> the first value for which
> x[n-i] <= x[n] - 5
>
> I am looking for
> a) the difference DATE[n] - DATE[n-i]
> b) the difference between x[n] and the highest HIGH value in rows n to n-i
>
>
> Date High Low
> 28/02/07 6286 6166
> 27/02/07 6435 6271
> 26/02/07 6447 6402
> 23/02/07 6402 6357
> 22/02/07 6416 6357
> 21/02/07 6430 6352
> 20/02/07 6448 6392
>
>
I don't altogether follow but, for a similar situation, I use database
functions. My date column is in ascending order so I use DMAX to find the
last price at which a stock traded. For example:
=VLOOKUP(DMAX(StockDayTable;"DATE";critVol);StockDayTable;5;0) . critVol is
the criterion range:
DATE HIGH LOW CLOSE OPEN VOL MOVE VALUE
>0
To find the highest price at which it traded in a given period:
=DMAX(StockDayTable;"HIGH";critDateCalcs) . critDateCalcs is the criterion
range:
DATE HIGH LOW CLOSE OPEN VOL MOVE VALUE
>=07/12/2006
The date in the previous row is calculated by a formula. It can be changed
by altering the length of the period in another cell.
You may instead be able to use a formula such as that given here:
http://www.oooforum.org/forum/viewtopic.phtml?p=130414#130414
--
View this message in context:
http://www.nabble.com/oocalc---find-value-bottom-%3Eup-tf3372550.html#a9386839
Sent from the openoffice - users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]