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

[Solved] DMAX using only one cell

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


Joined: 13 Apr 2012
Posts: 3

PostPosted: Fri Apr 13, 2012 6:32 am    Post subject: [Solved] DMAX using only one cell Reply with quote

Hi,

This is my data:

____A____B
1 monica__4
2 monica__3
3 monica__6
4 albert___1
5 albert___5
6 albert___4
7 albert___9
8 sarah__10
9 sarah___1

I need to fill cell C1 (and C2, C3...) with formula: largest value from B2:B11 but only for value given in A1.

Result should look like this:

____A____B__C
1 monica__4__6
2 monica__3__6
3 monica__6__6
4 albert___1__9
5 albert___5__9
6 albert___4__9
7 albert___9__9
8 sarah__10__10
9 sarah___1__10

Anybody knows how to do this?
I tried DMAX but (correct me if i'm wrong) it needs additional array under A1:C9 for every row.


Last edited by papierolot on Tue Apr 17, 2012 4:05 am; edited 1 time in total
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Fri Apr 13, 2012 6:43 am    Post subject: Reply with quote

Use a data pilot, subtotals or filters together with function SUBTOTAL.
Even better: Switch over to a real database.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
papierolot
Newbie
Newbie


Joined: 13 Apr 2012
Posts: 3

PostPosted: Fri Apr 13, 2012 6:57 am    Post subject: Reply with quote

Unfortunately I need to use spreadsheet because it is used to input data to a database.

Data Pilot in another sheet and then vlookup in column C did the job.

Thanks.
Back to top
View user's profile Send private message
ken johnson
Super User
Super User


Joined: 23 Apr 2009
Posts: 2032
Location: Sydney, Australia

PostPosted: Fri Apr 13, 2012 7:24 am    Post subject: Reply with quote

Code:
=SUMPRODUCT(MAX(($A$1:$A$9=A1)*$B$1:$B$9))
in C1 filled down to C9.

Ken Johnson
_________________
If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Fri Apr 13, 2012 3:36 pm    Post subject: Reply with quote

papierolot wrote:
Unfortunately I need to use spreadsheet because it is used to input data to a database.

Pardon? How do you do that? And once you have the data in the database, where is the problem? You can get any min, max, whatever from any subset of database rows.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
papierolot
Newbie
Newbie


Joined: 13 Apr 2012
Posts: 3

PostPosted: Fri Apr 13, 2012 5:10 pm    Post subject: Reply with quote

Villeroy wrote:
papierolot wrote:
Unfortunately I need to use spreadsheet because it is used to input data to a database.

Pardon? How do you do that? And once you have the data in the database, where is the problem? You can get any min, max, whatever from any subset of database rows.

I suppose I didn't explain it clear enough. I've got some data in csv and need to import it to database. To do this I need to convert some of columns and add additional one. I've got specific format which I have to use, because db isn't mine.

ken johnson wrote:
Code:
=SUMPRODUCT(MAX(($A$1:$A$9=A1)*$B$1:$B$9))
in C1 filled down to C9.

Ken Johnson

Even better, in one cell. It works!

Now I'm trying to figure out how.

------------------------------------------------------------

After reading:

http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_SUMPRODUCT_function
and
http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Conditional_Counting_and_Summation#SUMPRODUCT

I think I understood the formula. Thanks!
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Tue Apr 17, 2012 6:40 am    Post subject: Reply with quote

DMIN(List ; Field ; {"header1";"header2" | "value1";"=value2"}) works as well substituting the criteria range with a 2-dimensional array.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
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