[Solved] Get max and min of filtered cells

Discuss the spreadsheet application
Locked
forgottenBlock
Posts: 4
Joined: Sun Nov 17, 2024 4:15 pm

[Solved] Get max and min of filtered cells

Post by forgottenBlock »

I've got a table of values, where column A has a bunch of names that i want to search, values are in columm G and the thing to match is in I2 (capital i 2). I can get a sum of the values like this:

=SUMPRODUCT(A2:A23=I2;G2:G23)

And I could get an average by using SUMPRODUCT/COUNTIF. But what I want to get is MAX & MIN.

I've had a play with VLOOKUP but I don't know how to drive that right - plus I think VLOOKUP will only return "a" cell, not a list of cells with which I could then use min/max on.

Or another way to describe what I want to do is create a view on A2:A23-G2-G23 that only includes rows where the "A" column matches what is in I2. Can I do that without needing to use the UI? The reason for that is I've got a lot of variations in column A.

If I was using the GUI approach in Excel, I'd have a filter enabled for the sheet on column A, then select the column value I cared aviyt and then use min/max on the visible rows. That's awful because it is only 1 value at a time and I'd rather do a dozen or so.
Last edited by Hagar Delest on Fri Nov 22, 2024 10:23 pm, edited 2 times in total.
Reason: tagged solved.
OpenOffice 4.1.15 on Windows 10
User avatar
MrProgrammer
Moderator
Posts: 5105
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Hot to use sumproduct? do i need a pivot table?

Post by MrProgrammer »

forgottenBlock wrote: Sun Nov 17, 2024 4:31 pm But what I want to get is MAX & MIN.
You can't get max or min with SUMPRODUCT.
[Solved] MINIF and MAXIF Formulas
[Solved] Max/Min from VLOOKUP or SUMPRODUCT

forgottenBlock wrote: Sun Nov 17, 2024 4:31 pm … I want to … create a view …. Can I do that without needing to use the UI? The reason for that is I've got a lot of variations in column A.
You can create a view using this method.
[Tutorial] Sorting and Filtering data with formulas

If you need any additional assistance attach a document demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). I will not help further unless you attach. You would ned to explain more about a dozen or so before I could help with that filter usage. Both Standard Filter and Advanced Filter provide for multiple criteria.

I don't understand I cared aviyt.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.1, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
RoryOF
Moderator
Posts: 34796
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Hot to use sumproduct? do i need a pivot table?

Post by RoryOF »

A guess "aviyt" a mistyping of "about" - adjacent letters keyed.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Villeroy
Volunteer
Posts: 31325
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Get max and min of filtered cells

Post by Villeroy »

Filter the range and apply function SUBTOTAL.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Alex1
Volunteer
Posts: 794
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Get max and min of filtered cells

Post by Alex1 »

Here's an example. The minimum and maximum of G for each value of A are determined using a pivottable.
The getpivotdata function in E27 and E28 is used to display the minimum and maximum for the value of A in I2.
This has been created using LibreOffice. OpenOffice cannot use the same column more than once.
Attachments
Max and min of filtered cells.ods
(16.96 KiB) Downloaded 31 times
AOO 4.1.15 & LO 24.8.3 on Windows 10
forgottenBlock
Posts: 4
Joined: Sun Nov 17, 2024 4:15 pm

Re: Get max and min of filtered cells

Post by forgottenBlock »

I did some more Googling and found that AOO was my problem... upgrading to LOO v24.something has a MAXIFS function builtin which is exactly what I was looking for. What I wasn't looking for was the UI bugs that came with it. Sigh.
OpenOffice 4.1.15 on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32865
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Get max and min of filtered cells

Post by Hagar Delest »

What kind of UI bugs?
LibreOffice 24.8 on Xubuntu 24.10 and 24.8 portable on Windows 10
User avatar
Lupp
Volunteer
Posts: 3621
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Get max and min of filtered cells

Post by Lupp »

See also:
On Windows 10: LibreOffice 24.8.3 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Villeroy
Volunteer
Posts: 31325
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Get max and min of filtered cells

Post by Villeroy »

Alex1 wrote: Mon Nov 18, 2024 3:00 am This has been created using LibreOffice. OpenOffice cannot use the same column more than once.
Surely, it can. Open your file with AOO, get the dialog for your pivot table and double click the data field. The listbox with the aggregation functions is a multi-selection listbox.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Alex1
Volunteer
Posts: 794
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Get max and min of filtered cells

Post by Alex1 »

Villeroy wrote: Mon Nov 18, 2024 5:03 pm The listbox with the aggregation functions is a multi-selection listbox.
Nice!
AOO 4.1.15 & LO 24.8.3 on Windows 10
forgottenBlock
Posts: 4
Joined: Sun Nov 17, 2024 4:15 pm

Re: Get max and min of filtered cells

Post by forgottenBlock »

Hagar Delest wrote: Mon Nov 18, 2024 1:01 pm What kind of UI bugs?
Autocomplete to match text further up in the column is either hidden under the block cursor or just plain doesn't work.

e.g. if I have "Silver" in A1 and then in A2 I type "Sil", I get a solid black lump to the right of that suggesting that it might be "ver" when I press "Enter" but I can't tell. If the matching text is fully off the screen, I get a black blob and no clue about what LOO Calc wants to put there when I press "Enter'.
OpenOffice 4.1.15 on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32865
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Get max and min of filtered cells

Post by Hagar Delest »

Don't you see that?
Autocomplete.png
Autocomplete.png (13.58 KiB) Viewed 1299 times
Edit: taken with LO 24.8.2 portable on Windows 10.
LibreOffice 24.8 on Xubuntu 24.10 and 24.8 portable on Windows 10
User avatar
Lupp
Volunteer
Posts: 3621
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Get max and min of filtered cells

Post by Lupp »

What's this to do with the question?
On Windows 10: LibreOffice 24.8.3 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Hagar Delest
Moderator
Posts: 32865
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Get max and min of filtered cells

Post by Hagar Delest »

Lupp wrote: Wed Nov 20, 2024 6:09 pm What's this to do with the question?
Nothing at all. But I take that the problem has been solved long ago by upgrading to LO (or through the different replies with AOO). Thus I took the liberty to ask what kind of UI glitches could still prevent to use LO.
LibreOffice 24.8 on Xubuntu 24.10 and 24.8 portable on Windows 10
forgottenBlock
Posts: 4
Joined: Sun Nov 17, 2024 4:15 pm

Re: Get max and min of filtered cells

Post by forgottenBlock »

Hagar Delest wrote: Wed Nov 20, 2024 5:31 pm Don't you see that?
No.
auofail.png
auofail.png (1.26 KiB) Viewed 1121 times
OpenOffice 4.1.15 on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32865
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Get max and min of filtered cells

Post by Hagar Delest »

Then there is an issue with maybe high contrast or a dark theme.
But that's for another topic.
LibreOffice 24.8 on Xubuntu 24.10 and 24.8 portable on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32865
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Get max and min of filtered cells

Post by Hagar Delest »

Hagar Delest wrote: Thu Nov 21, 2024 10:45 pm Then there is an issue with maybe high contrast or a dark theme.
But that's for another topic.
Like this (new) one: Autoinput Suggestion 'Masked'.

By the way, thanks to add [Solved] at the beginning of the title in your first post (top of the topic) with the 🖉 button if your issue has been fixed.
LibreOffice 24.8 on Xubuntu 24.10 and 24.8 portable on Windows 10
User avatar
LastUnicorn
Posts: 676
Joined: Sat Mar 29, 2008 2:41 am
Location: Scotland

Re: Get max and min of filtered cells

Post by LastUnicorn »

@forgottenBlock

Read this thread again, if you haven't already done so. A 'fix' more like a temporary workaround was found in that thread: Autoinput Suggestion Masked
LibreOffice (Still) 24.2.7.2 (x64) installed to Windows 11 Pro.
Apache OpenOffice Portable 4.1.15 [Portable Apps]
For Java I use Adoptium Temurin JRE LTS Releases.
User avatar
Lupp
Volunteer
Posts: 3621
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Get max and min of filtered cells

Post by Lupp »

@forgottenBlock
@Hagar Delest
@LastUnicorn
Now I'm completely confused. For me, the topic of this thread is shown as “Get max and min of filtered cells”, and quite a few posts - among them one by myself - have regarded it. Then came a post with a changed subject, and corresponding content. Now the old title is back, but the content of the younger posts no longer matches it.
Can somebody explain this to me?
On Windows 10: LibreOffice 24.8.3 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
LastUnicorn
Posts: 676
Joined: Sat Mar 29, 2008 2:41 am
Location: Scotland

Re: Get max and min of filtered cells

Post by LastUnicorn »

In this thread the OP changed, or added a new topic, here: viewtopic.php?p=550132#p550132

Hagar identified that changed topic as being an issue similar to the new topic I posted here: viewtopic.php?t=112168

So, Hagar was just informing the OP of possible new information on his 'new topic' — but that new information was in another thread/topic. I posted in this thread to inform the OP of a possible solution/workaround to the changed topic he made in this thread.

Apologies, but that might be as clear as mud until anyone reads both threads. Arg!!!!! A mess!!!!!!
LibreOffice (Still) 24.2.7.2 (x64) installed to Windows 11 Pro.
Apache OpenOffice Portable 4.1.15 [Portable Apps]
For Java I use Adoptium Temurin JRE LTS Releases.
User avatar
Hagar Delest
Moderator
Posts: 32865
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] Get max and min of filtered cells

Post by Hagar Delest »

OK, let's stop here and lock the discussion. I consider that the initial question has been answered, with different methods. If someone disagrees then PM me or any other moderator and we can unlock the topic.

Note: the only title change was performed quite early by MrProgrammer because the first one given by OP was not very good, it can be seen in the first reply from MrProgrammer: Hot to use sumproduct? do i need a pivot table?
That is a standard moderator action to improve the understanding by others. It has been done cleverly after replying the initial post so that the initial title remains visible as the title of the reply (since each post in a discussion has a title). :super:
LibreOffice 24.8 on Xubuntu 24.10 and 24.8 portable on Windows 10
Locked