Find max corresponding value of multiple instances

Eddy2

New Member
Joined
Mar 2, 2017
Messages
27
Hi
Is there a formula to solve this problem in excel:
Sheet 1 – write a number in col. A à find all instances of that number in sheet 2, col. A, and the corresponding values in sheet 2 col. B. à Return the highs corresponding value in sheet 1 col B.

I.e. If I write 100 in cell A3 (sheet 1) the formula returns 30 in cell B3 ((sheet 1).

2ihou13.jpg
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Check out the MAX IF array function.

=MAX(IF(Sheet2!$A$2:$A$10=A2,Sheet2!$B$2:$B$10)) Ctrl Shift Enter
 
Last edited:
Upvote 0
Check out the MAX IF array function.

=MAX(IF(Sheet2!$A$2:$A$10=A2,Sheet2!$B$2:$B$10)) Ctrl Shift Enter

This works. Cheers!

Also got another solution that works:

IF you have Office 365 Excel use this:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">=MAXIFS(Sheet2!B:B,Sheet2!A:A,A3)
</code>If you do not have Office 365 but later then 2010:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">=AGGREGATE(14,6,Sheet2!B1:B100/(Sheet2!A1:A100=A3),1)
</code>If you are using 2007 or later then you will need to use this array formula:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">=MAX(IF(Sheet2!A1:A100=A3,Sheet2!B1:B100))
</code>Being an array formula it needs to be confirmed with Ctrl-Shift- Enter instead of Enter when exiting edit mode. If done correctly then Excel will put <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">{}</code> around the formula.
 
Upvote 0
Great! Glad to help. I am working with Excel 2010 so unfortunately MAXIF and MAXIFS are unavailable for me.
 
Upvote 0

Forum statistics

Threads
1,223,108
Messages
6,170,140
Members
452,304
Latest member
Thelingly95

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