| View previous topic :: View next topic |
| Author |
Message |
AlistairH Newbie

Joined: 10 Mar 2011 Posts: 2
|
Posted: Thu Mar 10, 2011 2:37 am Post subject: Calculate The Biggest Drop In A Column Of Numbers |
|
|
Does anyone know if there is an inbuilt function to do the following or do I need to write a macro?
I'm tracking the running total of my stocks and shares which, if plotted on a graph, goes up and down. I want to quickly calculate the biggest fall from the previous high point. For example, if I have a column of numbers like so...
1
2
3
4
5
6 << current high point
5
4
3
4
5
4
3
2 << current low point
3
4
5
6
7 << new high point
The result would be 4, even though there was a minor recovery in-between, it didn't reach the previous high point.
So the function will analyse the whole column of data, look at the drops from each high point as it finds them and ultimately returns the biggest it found in the whole range.
Though not necessarily a requirement just now, I envisage it being useful for the function to return where in the column that that drop occurred.
Thanks in advance |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Thu Mar 10, 2011 4:44 am Post subject: |
|
|
in B2 and filled down. Then:
| Code: | | =1+MATCH(MAX($B$2:B19);$B$2:B19;0) |
Not sure it does all you want it to, but perhaps it's a start. _________________ LibreOffice 3.6.6 on Fedora 18, LibreOffice 4.0.2 on Ubuntu 13.04 (Double Boot) |
|
| Back to top |
|
 |
AlistairH Newbie

Joined: 10 Mar 2011 Posts: 2
|
Posted: Fri Mar 11, 2011 3:11 am Post subject: |
|
|
| Nice bit of lateral thinking there Robert. Thanks |
|
| Back to top |
|
 |
|