OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Calculate The Biggest Drop In A Column Of Numbers

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
AlistairH
Newbie
Newbie


Joined: 10 Mar 2011
Posts: 2

PostPosted: Thu Mar 10, 2011 2:37 am    Post subject: Calculate The Biggest Drop In A Column Of Numbers Reply with quote

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
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Mar 10, 2011 4:41 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Robert Tucker
Moderator
Moderator


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

PostPosted: Thu Mar 10, 2011 4:44 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
AlistairH
Newbie
Newbie


Joined: 10 Mar 2011
Posts: 2

PostPosted: Fri Mar 11, 2011 3:11 am    Post subject: Reply with quote

Nice bit of lateral thinking there Robert. Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group