XLOOKUP within LAMBDA BYCOL

samdthompson

New Member
Joined
May 1, 2018
Messages
10
Hello, I am wanting to spill an xlookup of a maximum number but am hitting a #VALUE error. The basic format is:

weekcatratintended resultbasic intent
23416cat=xlookup(max(b2:c7),$b$2:$c$7,$b$1:$c$1))
34824cat
43715cat
52540rat
65445cat
73839rat

I get that xlookup wont work in this instance so would like to use BYROW but I cannot seem to get it working. I figured something like:

=BYROW(b2:c7,LAMBDA(v,a,r,XLOOKUP(v,a,r)(max(b2:c7),b2:c7,b1:c1)) would work but no dice. Since there is a substantial variation in the number of possible rows, I do want a spilling result.

And yes I get that I should be using the downloadable mini sheet thing but that would require me to have admin rights to install on my laptop.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
If I understand correctly, this is all you need:

Book1
ABCD
1WeekCatRatIntended Result
223416Cat
334824Cat
443715Cat
552540Rat
665445Cat
773839Rat
8
Sheet8
Cell Formulas
RangeFormula
D2:D7D2=IF(B2:B7>C2:C7,B1,C1)
Dynamic array formulas.
 
Upvote 0
If I understand correctly, this is all you need:

Book1
ABCD
1WeekCatRatIntended Result
223416Cat
334824Cat
443715Cat
552540Rat
665445Cat
773839Rat
8
Sheet8
Cell Formulas
RangeFormula
D2:D7D2=IF(B2:B7>C2:C7,B1,C1)
Dynamic array formulas.
your right, but i have a bunch more columns to deal with, I needed to truncate for simplicity. There should be something like 26 columns.
 
Upvote 0
Like this perhaps:

ABCDEFG
1catratdogslugResult
2341621cat
348245099slug
43715202cat
525404533dog
654656020rat
740393040cat
ColorCount
Cell Formulas
RangeFormula
G2:G7G2=LET(d,B2:E7,hdr,B1:E1,INDEX(hdr,BYROW(d=BYROW(d,LAMBDA(r,MAX(r))),LAMBDA(r,MATCH(TRUE,r,)))))
Dynamic array formulas.

Note that this will display only one result per row, even if there are duplicates.
 
Upvote 0
Solution
This is exactly right. Thanks so very much.


Like this perhaps:

ABCDEFG
1catratdogslugResult
2341621cat
348245099slug
43715202cat
525404533dog
654656020rat
740393040cat
ColorCount
Cell Formulas
RangeFormula
G2:G7G2=LET(d,B2:E7,hdr,B1:E1,INDEX(hdr,BYROW(d=BYROW(d,LAMBDA(r,MAX(r))),LAMBDA(r,MATCH(TRUE,r,)))))
Dynamic array formulas.

Note that this will display only one result per row, even if there are duplicates.
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,930
Members
449,479
Latest member
nana abanyin

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