Lookup a value and then find the largest in a range

fazthfc

New Member
Joined
May 6, 2015
Messages
4
Hi,

I have a set of data that looks like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]12[/TD]
[TD]15[/TD]
[TD]16[/TD]
[TD]10[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]6[/TD]
[TD]4[/TD]
[TD]15[/TD]
[TD]1[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]22[/TD]
[TD]14[/TD]
[TD]13[/TD]
[TD]17[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]6[/TD]
[TD]8[/TD]
[TD]7[/TD]
[TD]10[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]8[/TD]
[TD]9[/TD]
[TD]15[/TD]
[TD]26[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]F[/TD]
[TD]10[/TD]
[TD]14[/TD]
[TD]19[/TD]
[TD]2[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD]15[/TD]
[TD]16[/TD]
[TD]20[/TD]
[TD]25[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]H[/TD]
[TD]16[/TD]
[TD]20[/TD]
[TD]22[/TD]
[TD]10[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]14[/TD]
[TD]16[/TD]
[TD]19[/TD]
[TD]17[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]

In another sheet I have the list of names but not in the same order (there is a reason for that). I want a formula that will look for the Name in column A and then return the largest number for that name in columns B:F.

For example:

Forumula looks at the name sees E and returns 26.

I've tried looking at HLOOKUP, MATCH and INDEX but can't find a way of looking at the range based on a specific criteria.

Any help greatly appreciated.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi,

I use the max formula on a line and set up the number of line with a match in the column. Indirect put them together.

Code:
=MAX(INDIRECT("Sheet1!$B$"&MATCH(Sheet2!A2;Sheet1!$A$1:$A$10)&":$F$"&MATCH(Sheet2!A2;Sheet1!$A$1:$A$10)))

I can go in more details if it does not work for you
 
Upvote 0
Hi faz,

Maybe this;


Book1
ABCDEF
1Name12345
2A121516106
3B6415119
4C2214131710
5D687106
6E8915264
7F101419210
8G1516202515
9H162022108
10I141619176
Sheet1



Book1
AB
1NameMax
2A16
3H22
4C22
5G25
6E26
7F19
8D10
9B19
10I19
Sheet2
Cell Formulas
RangeFormula
B2{=MAX(IF(Sheet1!$A$2:$A$10=A2,Sheet1!$B$2:$F$10))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hello,

With your Table in Sheet1 ... and your formula in Sheet2 ...

Cell A2 : B

Cell B2 :
Code:
=MAX(OFFSET(Sheet1!$A$1,MATCH(A2,Sheet1!$A$2:$A$10,0),1):OFFSET(Sheet1!$A$1,MATCH(A2,Sheet1!$A$2:$A$10,0),5))

Hope this will help
 
Upvote 0
Another option


Book1
ABCDEF
1Name12345
2A121516106
3B6415119
4C2214131710
5D687106
6E8915264
7F101419210
8G1516202515
9H162022108
10I141619176
Sheet1



Book1
AB
2A16
3C22
4F19
5G25
Sheet3
Cell Formulas
RangeFormula
B2=MAX(INDEX(Sheet1!$B$2:$F$10,MATCH(A2,Sheet1!$A$2:$A$10,0),0))
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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