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

Finding the second lowest number in a list

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


Joined: 04 Feb 2008
Posts: 2

PostPosted: Mon Feb 04, 2008 11:38 am    Post subject: Finding the second lowest number in a list Reply with quote

I am having some troubles getting a the second lowest number in a row of numbers to display in a cell. After searching around on this forum I came up with this, which works, but does not work if there are two 0's in the same row. Here is what I currently have:

=SMALL(D4:M4;COUNTIF(D4:M4;O4)+1)

With out the +1, it simply finds the lowest number, I know there has to be a way to do this, but I just am not smart enough.
Back to top
View user's profile Send private message
David
Super User
Super User


Joined: 24 Oct 2003
Posts: 5668
Location: Canada

PostPosted: Mon Feb 04, 2008 1:46 pm    Post subject: Reply with quote

Try this:

In A1: =SMALL(D4:M4;2)
In A2: =COUNTIF($D$4:$M$4;A1)
In A3: =SMALL(D4:M4;A2+1)

David.
Back to top
View user's profile Send private message
Arstron
Newbie
Newbie


Joined: 04 Feb 2008
Posts: 2

PostPosted: Mon Feb 04, 2008 2:06 pm    Post subject: Reply with quote

I get this for each cell
a1: 0
a2: 2
a3: 6

this is the number sequence: 0 0 28 6

After trying a few things I noticed that on any row that has the same lowest and second lowest numbers, it would ignore the second lowest number and go on to the 3rd highest. This is what I am now using, but it still will not show a 0 if there are two 0's in a sequence

=IF(SMALL(D6:M6;COUNTIF(D6:M6;O6))=O6;SMALL(D6:M6;COUNTIF(D6:M6;O6)+1);(SMALL(D6:M6;COUNTIF(D6:M6;O6)))).

Never mind, I now see that the first one is all that I was needing, it is working great, thanks a lot!
Back to top
View user's profile Send private message
huwg
Super User
Super User


Joined: 14 Feb 2007
Posts: 890

PostPosted: Tue Feb 05, 2008 2:06 am    Post subject: Reply with quote

Arstron wrote:
=SMALL(D4:M4;COUNTIF(D4:M4;O4)+1)
What is in cell O4?

I think you are after the second lowest non-zero value in the range D4:M4
In which case, this works for me:
Code:
=SMALL(D4:M4;COUNTIF(D4:M4;0)+2)
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