[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

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
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10106
Location: Germany

 Posted: Thu Mar 10, 2011 4:41 am    Post subject: I suggest something along this line: http://www.oooforum.org/forum/viewtopic.phtml?t=115695_________________Rest in peace, oooforum.org Get help on https://forum.openoffice.org
Robert Tucker
Moderator

Joined: 16 Aug 2004
Posts: 3407
Location: Manchester UK

Posted: Thu Mar 10, 2011 4:44 am    Post subject:

 Code: =MAX(\$A\$2:A2)-A2

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.
_________________
OpenOffice 4.0.0 and LibreOffice 4.x.x on Fedora 20, Ubuntu 13.10, Windows 8.1 Preview (Triple Boot)
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
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum