Forum Discussion
Help with a Formula
Your error is coming from TEXTSPLIT() when the input is blank / not text (or when the filter returns no rows). Make the split ranges “safe” by coercing to text and providing a fallback.
Try this pattern (key change: IFERROR(TEXTSPLIT(...), value) and &"" to coerce to text):
=LET( f, FILTER(Detail!$A:$BZ, (COUNTIF($B$16:$B$25,Detail!$BP:$BP)>0) * (TRIM(SUBSTITUTE(Detail!$AW:$AW,CHAR(160),""))<>"") ), base, CHOOSECOLS(f,1,3,4,5,68), c49, SUBSTITUTE(CHOOSECOLS(f,49)&"",CHAR(160),""), split49, IFERROR(TRIM(TEXTSPLIT(c49,",")), TRIM(c49)), c53, SUBSTITUTE(CHOOSECOLS(f,53)&"",CHAR(160),""), split53, IFERROR(TRIM(TEXTSPLIT(c53,",")), TRIM(c53)), SORT(UNIQUE(HSTACK(base,split49,split53)),1,TRUE) )
If you also want to avoid errors when FILTER returns nothing, wrap f:
f, IFERROR(FILTER(...), "")
That should stop the #VALUE! and still “explode” comma-separated values when present.
Let me know, if it works or not...