Forum Discussion
Skipping Blank cells in formulas
- Jan 11, 2024
Actually, how do you get the table that excludes blanks? I see Q5 just says '=LET(', but what does this mean and how does this know to reference Table 1?
If you increase the size of the formula bar you'll see that in Q5 the formula is (I updated it - feel free to re-download the sample I earlier shared):
=LET( n, F5, FilterCol, LAMBDA(col, LET(values, CHOOSECOLS(Table1,col), FILTER(values,ISNUMBER(values),FALSE))), StackCol, LAMBDA(init,col, HSTACK(init, TAKE(FilterCol(col),-n))), Array, IFNA(DROP(REDUCE("",SEQUENCE(COLUMNS(Table1)), StackCol),,1),FALSE), Array )
where you can see the 2 references to Table1
If you want to make it more obvious or for easier maintenance you can use:
=LET( myTable, Table1, n, F5, FilterCol, LAMBDA(col, LET(values, CHOOSECOLS(myTable,col), FILTER(values,ISNUMBER(values),FALSE))), StackCol, LAMBDA(init,col, HSTACK(init, TAKE(FilterCol(col),-n))), Array, IFNA(DROP(REDUCE("",SEQUENCE(COLUMNS(myTable)), StackCol),,1),FALSE), Array )
Hi jsinghbest
(Thanks for posting a sample) Haven't looked deeply at your issue yet
What version of Excel do you run?
- jsinghbestJan 10, 2024Copper Contributor
Thanks for your reply.
I believe it is Excel for Microsoft 365, the full title of what (I assume) is the version name is below:
Microsoft® Excel® for Microsoft 365 MSO (Version 2310 Build 16.0.16924.20054) 64-bit
- LorenzoJan 10, 2024Silver Contributor
Hi jsinghbest
With 365, could you check that the values highlighted in green in 'Sheet2' are the expected ones against the values I used in Table1 (something isn't clear to me...)?
- jsinghbestJan 10, 2024Copper ContributorHey there,
After taking out a few misplaced '0's, yes that looks right! Please may you explain how you solved the problem?
Thanks