Vlookup combined with max

HassanF

New Member
Joined
Sep 27, 2011
Messages
5
Right, for illustration purposes I have two columns:
A B<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
1 18<o:p></o:p>
1 18<o:p></o:p>
1 20<o:p></o:p>
0 28<o:p></o:p>
1 30 <o:p></o:p>
0 25<o:p></o:p>
<o:p> </o:p>
I use column one to define "include" (1) and "exclude" (0). I want to set up a formula that returns the largest number in column B, provided that this row is included (i.e. corresponding cell in A column is 1). I have tried vlookup and with a max function nested but I only get back the first number in column B.<o:p></o:p>
<o:p> </o:p>
Any suggestions would be much appreciated.<o:p></o:p>
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hello HassanF, welcome to MrExcel

Try an array formula like this

=MAX(IF(A2:A10=1,B2:B10))

confirmed with CTRL+SHIFT+ENTER
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

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