| View previous topic :: View next topic |
| Author |
Message |
papierolot Newbie

Joined: 13 Apr 2012 Posts: 3
|
Posted: Fri Apr 13, 2012 6:32 am Post subject: [Solved] DMAX using only one cell |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Fri Apr 13, 2012 6:43 am Post subject: |
|
|
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 http://forum.openoffice.org |
|
| Back to top |
|
 |
papierolot Newbie

Joined: 13 Apr 2012 Posts: 3
|
Posted: Fri Apr 13, 2012 6:57 am Post subject: |
|
|
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 |
|
 |
ken johnson Super User

Joined: 23 Apr 2009 Posts: 1851 Location: Sydney, Australia
|
Posted: Fri Apr 13, 2012 7:24 am Post subject: |
|
|
| 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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Fri Apr 13, 2012 3:36 pm Post subject: |
|
|
| 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 http://forum.openoffice.org |
|
| Back to top |
|
 |
papierolot Newbie

Joined: 13 Apr 2012 Posts: 3
|
Posted: Fri Apr 13, 2012 5:10 pm Post subject: |
|
|
| 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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Tue Apr 17, 2012 6:40 am Post subject: |
|
|
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 http://forum.openoffice.org |
|
| Back to top |
|
 |
|