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

Author Message
pcman312
Newbie

Joined: 08 May 2012
Posts: 3

Posted: Tue May 08, 2012 4:04 pm    Post subject: Calc dmin/dmax questions

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

Joined: 04 Oct 2004
Posts: 10081
Location: Germany

 Posted: Tue May 08, 2012 4:45 pm    Post subject: Your numbers are text. Chars that happen to be digits._________________Rest in peace, oooforum.org Get help on http://forum.openoffice.org
pcman312
Newbie

Joined: 08 May 2012
Posts: 3

 Posted: Wed May 09, 2012 8:00 am    Post subject: 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.
pcman312
Newbie

Joined: 08 May 2012
Posts: 3

 Posted: Wed May 09, 2012 8:04 am    Post subject: 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.
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10081
Location: Germany

 Posted: Wed May 09, 2012 8:59 am    Post subject: Works for me._________________Rest in peace, oooforum.org Get help on http://forum.openoffice.org
JohnV

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

Posted: Wed May 09, 2012 11:05 am    Post subject:

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.
 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