LET formula to spill dynamically

MurdochQuill

Board Regular
Joined
Nov 21, 2020
Messages
84
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have another question regarding =LET.

I currently use this let formula
Excel Formula:
=LET(Drng,'Sheet1'!$A$1:$A$20,Rng,F2,IF(SUM((Drng<>"")*(ISNUMBER(MATCH("*"&Drng&"*",Rng,0)))), "Y", "N"))

This works fine when I fill down. I'm wondering how to change "F2" in this formula to reference the current row, and to also make this formula spill according to my global variable "MaxRows"
EG, the formula should then cover from G2:G52 (As the value of MaxRows is 52).

For future reference, could someone run through the steps to make it do this? I'm still not quite understanding how to make it work each time.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I'm wondering how to change "F2" in this formula to reference the current row, and to also make this formula spill according to my global variable "MaxRows"
If you want it to spill then you use the entire range, not the current row. Change F2 to F2:INDEX(F:F,MaxRows)

You will also need to remove the SUM function and just have the array on its own, otherwise the results will be aggregated.
 
Upvote 0
If you want it to spill then you use the entire range, not the current row. Change F2 to F2:INDEX(F:F,MaxRows)

You will also need to remove the SUM function and just have the array on its own, otherwise the results will be aggregated.
Thanks for the help!
Yes, I have tried to use this INDEX syntax, however then we will be comparing the entire array "Rng" with "Drng".
I would like to compare the row EG: ROW() where the formula exists. So it would be comparing the active row in "Rng" with the entire array of "Drng".

Any ideas on how to add this into my formula?
 
Upvote 0
Sorry to bump; but does anyone know how to edit this to reference the current row in the dynamic range?
 
Upvote 0
It's not going to spill unless it returns an array of results, which it won't do if you only use one cell as the criterion.
 
Upvote 0
Any ideas on how to add this into my formula?
Exactly how I said in my reply. Use the INDEX method and remove SUM.

If it doesn't do what you need it to then it is your question that is wrong, not the answer provided. You have said how you are trying to do something but not what you are actually trying to do so it is possible that you are taking an incorrect approach to the task. Without more information or mind reading abilities we could spend a lot of time guessing incorrectly.
 
Upvote 0
After a bit of head scratching, I think that this might be what you're attempting.
Excel Formula:
=LET(Drng,TRANSPOSE(Sheet1!$A$1:$A$20),Rng,F2:INDEX(F:F,MaxRows),IF(MIN(LEN(SUBSTITUTE(Rng,Drng,"")))<LEN(Rng),"Y","N"))
 
Upvote 0
Sorry for my lack of elaboration.

I'm trying to make col A spill down like col C is. Col C is returning the column value, which is what I want to replace "f2" on my original formula with.

Here's an example sheet to make it clear what I'm doing
LIST.xlsm
ABCDEFGHIJ
1Code found?Code found? Spill to maxrowsExample spillMixed codesMatch StringMaxrows
2YES$F$2sdaHello1dsfsdHello110
3NO$F$334f43t4Hello2
4NO$F$454y54y53Bye
5YES$F$5dsfsHello1mbmbmb2Bye
6YES$F$6etjrjyrjty2Bye
7NO$F$7sjfdgnjs
8NO$F$8shthmrhkBye
9NO$F$9safreHello
10YES$F$10dsggmkmkm 2Bye 1111
Sheet2
Cell Formulas
RangeFormula
C2:C10C2=ADDRESS(ROW(F2:INDEX(F:F,Maxrows))-ROW(F2)+2,6)
A2:A10A2=IF(SUM(($H$2:$H$10<>"")*(ISNUMBER(MATCH("*"&$H$2:$H$10&"*",$F2,0)))), "YES", "NO")
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Maxrows=Sheet2!$J$2C2
 
Upvote 0
Did you try the formula in post 7?
Yes. I'm not trying to use a length comparison.
I'm still unsure how to tackle this, as I'm looking for the "Match string" array inside "Mixed codes" per row. The Match string array is on another page usually, which is just a bunch of terms to look up.

list
ABCDEFGHIJ
1Code found?Code found? Spill to maxrowsExample spillMixed codesMatch StringMaxrows
2YESY$F$2sdaHello1dsfsdHello110
3NON$F$334f43t4Hello2
4NON$F$454y54y53Bye
5YESY$F$5dsfsHello1mbmbmb2Bye
6YESY$F$6etjrjyrjty2Bye
7NOY$F$7sjfdgnjs
8NOY$F$8shthmrhkBye
9NOY$F$9safreHello
10YESY$F$10dsggmkmkm 2Bye 1111
Sheet2
Cell Formulas
RangeFormula
B2:B10B2=LET(Drng,TRANSPOSE($H$1:$H$20),Rng,F2:INDEX(F:F,Maxrows),IF(MIN(LEN(SUBSTITUTE(Rng,Drng,"")))<LEN(Rng),"Y","N"))
C2:C10C2=ADDRESS(ROW(F2:INDEX(F:F,Maxrows))-ROW(F2)+2,6)
A2:A10A2=IF(SUM(($H$2:$H$10<>"")*(ISNUMBER(MATCH("*"&$H$2:$H$10&"*",INDEX(F:F,ROW()),0)))), "YES", "NO")
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Maxrows=Sheet2!$J$2B2:C2
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
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