sumproduct with max

BeLZeBuT

New Member
Joined
Aug 17, 2021
Messages
6
Office Version
  1. 2013
Platform
  1. Windows
Hi everyone. I would appreciate your help.

I have a workbook with multiple sheets.

in the sheet1 i must return the value from the sheet by the folowing criteria>

suppose o sheet1 i select name 'John', and from the sheet2 that has the structure, i must return the addiacent cell value (col. B), that coresponding to the max value in col. C

Book1.xlsx
ABC
1John34896553
2Mary 792416,61
3John860903,62
4Mary 901028,92
5Mary 2923,573
6John3197,571
Sheet2


in this case i want to return 3489655 (cell A2).

i can only get the max for John with formula
Excel Formula:
=SUMPRODUCT(MAX(((Sheet2!A:A=A1) * (Sheet2!C:C))))

Please help me.
3489655​
 
Think this does it

=INDEX(Sheet2!B1:B6,MATCH(MAX(IF(Sheet2!A1:A6=A1,Sheet2!C1:C6)),IF(Sheet2!A1:A6=A1,Sheet2!C1:C6),0))
 
Upvote 0
Solution

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
It's stange! All the formulas that give you to me (Phuoc, Peter_SSs, Special-K99) are work with less data. But, if I try with more data (2000 rows) - I get 0, #N/A or #NUM.
 
Upvote 0
I just tested all 3 formulas with 3,000 rows of data with no problems.

If you have any error values in your Sheet2 data then some of the formulas may return error values, depending on just where the error values are. Are you sure that there are no error values in Sheet2?
 
Upvote 0
Finally, the all 3 are solutions are good (offered by Phuoc, Peter_SSs, Special-K99). I've found on sheet2 a different type on column C (number and text), and i give errors. Now is good. Thank you all!
 
Upvote 0
Great that you got it resolved. Thanks for letting us know. Glad we could help. :)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

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