MAXIFS Based On One Criteria

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
252
Office Version
  1. 365
Platform
  1. Windows
I have a workbook with 5 worksheets, Sheet1 through Sheet5 plus a Totals worksheet. Each of the 5 worksheets has a list of players in column A and a total of their scores in column E. There are 18 different players, but the order that they are in on the 5 worksheets varies.

I need to enter a formula on the Totals worksheet for each player that will provide the MAX value for each player across all 5 worksheets. I tried:

=MAXIFS(Sheet1:Sheet5!E2:E19,Sheet1:Sheet5!A2:A19,Total!G3)

and get a #VALUE! error.

Is this possible?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I don't think that you can do what @6StringJazzer has suggested because MAXIFS requires range inputs, not arrays. However using that concept this way might suit you?

Utilizing 2 spare columns on the 'Totals' sheet (I used columns Y:Z) in cell Y3 of 'Totals' I put the formula
Excel Formula:
=CHOOSECOLS(VSTACK(Sheet1:Sheet5!A2:E19),1,5)
These two columns could them be hidden if you want.

Then to get the max values, this formula (in H3?)
Excel Formula:
=MAXIFS(TAKE(Y3#,,-1),TAKE(Y3#,,1),G3:G20)
 
Upvote 0
Someone came up with this formula:

=MAX(MAXIFS(INDIRECT("'"&Sheets&"'!"&"E1:E18"),INDIRECT("'"&Sheets&"'!"&"A1:A18"),A2))

Where "Sheets" is the named range for all the worksheet names. It works perfectly, but I'm not sure I understand why. Any thoughts?
 
Upvote 0
I would be avoiding the volatile function INDIRECT if possible.
Here is another option (non-volatile), doesn't require the helper columns I suggested earlier, doesn't require the named range and fills all answers with the formula in a single cell without needing to copy down.

Excel Formula:
=BYROW(A2:A19,LAMBDA(r,LET(w,WRAPROWS(TOCOL(Sheet1:Sheet5!A1:E18),5),MAX(FILTER(TAKE(w,,-1),TAKE(w,,1)=r)))))
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,822
Members
449,470
Latest member
Subhash Chand

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