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

Calc dmin/dmax questions

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


Joined: 08 May 2012
Posts: 3

PostPosted: Tue May 08, 2012 4:04 pm    Post subject: Calc dmin/dmax questions Reply with quote

I'm trying to do a minimum/maximum (and some other functions) using a conditional. I'm trying to use dmin/dmax for this, but am becoming frustrated since the only non-error I can get is 0.

I have the following (fake) data:
Code:
Col 1    Col 2
A        3
A        2
A        5
B        3
B        1


I want to get the min/max value in Col 2 where Col 1 = A, B and so on.

I tried using this example: http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_DMIN_function
I even copied it verbatim into Calc, but the result it gave was 0, not 300 as described in the example.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Tue May 08, 2012 4:45 pm    Post subject: Reply with quote

Your numbers are text. Chars that happen to be digits.
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
Back to top
View user's profile Send private message
pcman312
Newbie
Newbie


Joined: 08 May 2012
Posts: 3

PostPosted: Wed May 09, 2012 8:00 am    Post subject: Reply with quote

I tried converting them to numbers:

Attempt 1: Format->Cells... -> Number/General
Attempt 2: Put an = in front of all numbers
Attempt 3: Wrapped each number in VALUE()

All of which still returned 0.
Back to top
View user's profile Send private message
pcman312
Newbie
Newbie


Joined: 08 May 2012
Posts: 3

PostPosted: Wed May 09, 2012 8:04 am    Post subject: Reply with quote

If I change the search criteria from 2 to >2, it works and gives me 150. I'm clearly not doing something needed to do an equals rather than a greater/less than.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Wed May 09, 2012 8:59 am    Post subject: Reply with quote

Works for me.
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 8982
Location: Lexinton, Kentucky, USA

PostPosted: Wed May 09, 2012 11:05 am    Post subject: Reply with quote

Set your spreadsheet up as follows.

Cells A1:B6
Code:
Col 1   Col 2
A       3
A       2
A       5
B       3
B       1

Note - the numbers in column B will be right aligned, as opposed left aligned as show
above, if they are in fact numbers and not text.*

Cells A8:B9
Code:
Col 1   Col 2
A    


Your formula in any cell but those above is
=DMIN(A1:B6;2;A8:B9) or
=DMIN(A1:B6;B1;A8:B9) or
=DMIN(A1:B6;"Col 2";A8:B9)
and should return 2.

* Converting text to numbers - usually works.
Find and Replace
Search = ^.
Replace = &
Under More Option check Regular Expressions and then do a Replace All.
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