Google Sheets: MAXIFS formula which returns adjacent column data?

Chrizh

New Member
Joined
Jul 30, 2022
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
Hi all. I'm struggling with a formula. I have a spreadsheet ('Base Stats') of data. Column B contains a name. Column M contains scores (calculated from values in other columns). Column N contains a rank (1-5).

On another sheet ('Testing') I would like to pull some of the data based on rank and score. I have formulas which will return the maximum score for each rank based on the name:

=MAXIFS('Base Stats'!M:M, 'Base Stats'!B:B, "Acorna", 'Base Stats'!N:N, "1")
=MAXIFS('Base Stats'!M:M, 'Base Stats'!B:B, "Acorna", 'Base Stats'!N:N, "2")
=MAXIFS('Base Stats'!M:M, 'Base Stats'!B:B, "Acorna", 'Base Stats'!N:N, "3")
=MAXIFS('Base Stats'!M:M, 'Base Stats'!B:B, "Acorna", 'Base Stats'!N:N, "4")
=MAXIFS('Base Stats'!M:M, 'Base Stats'!B:B, "Acorna", 'Base Stats'!N:N, "5")

This returns the correct maximum values for that rank. What I would also like the formula to do however, is also return some other information from the same row?

For example, taking the first formula above:

=MAXIFS('Base Stats'!M:M, 'Base Stats'!B:B, "Acorna", 'Base Stats'!N:N, "1")

Will return the value 358.2. This is pulled from column M row 8 on 'Base Stats'. I would also like the retrieve the values of column C and D row 8.

I think that I maybe need to use INDEX or QUERY for this. I've tried to do this with INDEX but it errors. My spreadsheet can be found at:


Your help is greatly appreciated :)
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How about
Excel Formula:
=ARRAY_CONSTRAIN(FILTER(SORT(FILTER('Base Stats'!C2:M3335,('Base Stats'!B2:B3335=B4)*('Base Stats'!N2:N3335=A4)),11,0),{1,1,0,0,0,0,0,0,0,0,1}),1,3)
 
Upvote 0
Solution
How about
Excel Formula:
=ARRAY_CONSTRAIN(FILTER(SORT(FILTER('Base Stats'!C2:M3335,('Base Stats'!B2:B3335=B4)*('Base Stats'!N2:N3335=A4)),11,0),{1,1,0,0,0,0,0,0,0,0,1}),1,3)

Superb! Thank you. That works perfectly. I just now need to work out how to return blanks instead of #N/A because sometimes an entry is not available for every star rating (rank). I'll see if I can add an IFERROR somewhere.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top