Lookup delivering result of max number

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
435
Office Version
  1. 365
Platform
  1. Windows
I have a lookup up "East of England" D2 in a cell from a separate workbook and I want to look into the data shown below.
Looking for the row that "East of England" is in and finding the largest number then delivering back to me the number that is in row 3
So the answer would be 131921 returning the number 1.
I just can't work out how I use either vlookup, xlookup or index and match.
Any help would be appreciated please.
Thank you.

1644054809084.png
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Please consider XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. ;)

See if you could use something like this.

BTW, what should happen if the relevant row has 2 (or more) equal maximum values?

22 02 05.xlsm
WXYZAAABACADAEAF
1
2
31234
4
5
6f2a841270843507
7b921721958801
8c369154811985
9d751211803253
10e578689365372
11f8232614142
12g872680752837
13h872791730657
14i835299647492
15j173115834667
16k54836271
17l22661449166
18m526121389838
19n7397785016
Lookup
Cell Formulas
RangeFormula
X6X6=LET(rw,FILTER(AC6:AF19,AA6:AA19=W6),INDEX(AC3:AF3,MATCH(MAX(rw),rw,0)))
 
Upvote 0
Thank you most helpful. I've never used the "LET" before
I have tried to install XL2BB a couple of time but without great success but will try again
I did have a further mess around with the formula and came up with a bit of a long winded approach below, but seemed to work okay

XLOOKUP(MAX(INDEX('[Attribute Analysis.xlsm]Summary'!$AB:$AL,MATCH(F2,'[Attribute Analysis.xlsm]Summary'!$AA:$AA,0),0)),INDEX('[Attribute Analysis.xlsm]Summary'!$AB:$AL,MATCH(F2,'[Attribute Analysis.xlsm]Summary'!$AA:$AA,0),0),'[Attribute Analysis.xlsm]Summary'!$AB$3:$AL$3,"")
 
Upvote 0
I have tried to install XL2BB a couple of time but without great success but will try again
If you would like to tell us about ..
- at what point in these instructions do you run aground, and
- what the actual problem is at that point
.. then we can quite possible assist with resolving the problem

I did have a further mess around with the formula and came up with a bit of a long winded approach below, but seemed to work okay
If you wanted to persist with XLOOKUP, then LET could also make that much shorter.
I have assumed that cell F2 in the formula sheet and column AA in the Summary sheet are text values not numerical.

Excel Formula:
=LET(rng,'[Attribute Analysis.xlsm]Summary'!$AA:$AL,rw,INDEX(rng,MATCH(F2,INDEX(rng,0,1),0),0),XLOOKUP(MAX(rw),rw,INDEX(rng,3,0)))

Also, you did not address the question below. Is that situation possible with your data?
BTW, what should happen if the relevant row has 2 (or more) equal maximum values?
 
Upvote 0
Solution
I'll have another go at XL2BB.
Regarding the duplicate numbers - That won't be a concern for this calculation because this data is for store clusters and if the number is the same it means the cluster could be either one or the other, so not an issue.
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

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