r/excel • • Jun 03 '26

Waiting on OP Need to filter out #NA results from filtering out VSTACK with multiple arrays

Hello!

I have multiple checklists tables in a sheet and I'm trying to create a vstack consolidating anything that I haven't chekmarked with the notes column next to it

This is what I currently have

=LET(a,VSTACK(FILTER(CHOOSECOLS(Table17,1,-1),(Table17[Tick = Pass]=FALSE)*(LEN(Table17[Notes])>0),""),FILTER(CHOOSECOLS(Table1,1,-1),(Table1[Tick = Pass]=FALSE)*(LEN(Table1[Notes])>0),""),FILTER(CHOOSECOLS(Table3,1,-1),(Table3[Tick = Pass]=FALSE)*(LEN(Table3[[Notes ]])>0),""),FILTER(CHOOSECOLS(Table2,1,-1),(Table2[Tick = Pass]=FALSE)*(LEN(Table2[Notes])>0),""),FILTER(CHOOSECOLS(Table4,1,-1),(Table4[Tick = Pass]=FALSE)*(LEN(Table4[[Notes ]])>0),"")),b,IF(a="","",a),b)

But I keep getting these #N/A results. Ideally I want to remove these #N/A results and also not have any weird gaps between results. I'm completely lost and don't know if what I want is even possible

Any and all help is appreciated

18 Upvotes

10 comments sorted by

•

u/AutoModerator Jun 03 '26

/u/mullet4superman - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/excelevator 3071 Jun 03 '26

find which line generates the #N/A and manage as required, you can easily use each line on its own to determine the output

=LET(a,VSTACK(
FILTER(CHOOSECOLS(Table17,1,-1),(Table17[Tick = Pass]=FALSE)*(LEN(Table17[Notes])>0),""),
FILTER(CHOOSECOLS(Table1,1,-1) ,(Table1 [Tick = Pass]=FALSE)*(LEN(Table1 [Notes])>0),""),
FILTER(CHOOSECOLS(Table3,1,-1) ,(Table3 [Tick = Pass]=FALSE)*(LEN(Table3 [[Notes ]])>0),""),
FILTER(CHOOSECOLS(Table2,1,-1) ,(Table2 [Tick = Pass]=FALSE)*(LEN(Table2 [Notes])>0),""),
FILTER(CHOOSECOLS(Table4,1,-1) ,(Table4 [Tick = Pass]=FALSE)*(LEN(Table4 [[Notes ]])>0),"")),
b,IF(a="","",a),b)

2

u/MayukhBhattacharya 1327 Jun 03 '26

Assuming the Columns [Tick = Pass] and [Notes] is 3 and 4, then you could try something like this which is cleaner and easier to read (Change the column index of [Tick = Pass] and [Notes] with the one you have):

=LET(
     _a, VSTACK(Table17, Table1, Table3, Table2, Table4),
     _b, CHOOSECOLS(_a, 1, -1),
     _c, CHOOSECOLS(_a, 3),
     _d, CHOOSECOLS(_a, 4),
     _e, MMULT(--(_b <> ""), SEQUENCE(COLUMNS(_b), , , 0)),
     FILTER(_b, (_c = FALSE) * (LEN(IFERROR(_d, "")) > 0) * (_e > 0), ""))

Note that the MMULT() is used to filter out any rows where all columns are empty strings and counts non-empty cells per row, any row with a count of 0 gets dropped.

You can also use BYROW() function instead of MMULT()

=LET(
     _a, VSTACK(Table17, Table1, Table3, Table2, Table4),
     _b, CHOOSECOLS(_a, 1, -1),
     _c, CHOOSECOLS(_a, 3),
     _d, CHOOSECOLS(_a, 4),
     _e, BYROW(_b, COUNTA),
     FILTER(_b, (_c = FALSE) * (LEN(IFERROR(_d, "")) > 0) * (_e > 0), ""))

2

u/MayukhBhattacharya 1327 Jun 03 '26

One more thing, I would like to add, to find exactly where the #N/A is coming from, use the Evaluate Formula feature found under the Formulas Tab (See Screenshot), click the cell with your formula and then go to Formulas tab under the Formula Auditing Group select Evaluate Formula. Next, keep hitting the Evaluate to step through each part of the formula, check for when the #N/A first appears, that helps you to debug the formula and fix the issue.

2

u/MayukhBhattacharya 1327 Jun 03 '26

Or wrap an IFERROR() around the variables,

=LET(
     _a, VSTACK(Table17, Table1, Table3, Table2, Table4),
     _b, IFERROR(CHOOSECOLS(_a, 1, -1), ""),
     _c, IFERROR(CHOOSECOLS(_a, 3), TRUE),
     _d, IFERROR(CHOOSECOLS(_a, 4), ""),
     _e, BYROW(_b, COUNTA),
     FILTER(_b, (_c = FALSE) * (LEN(_d) > 0) * (_e > 0), ""))

1

u/Decronym Jun 03 '26 edited Jun 03 '26

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer LettersMore Letters
BYROWOffice 365+: Applies a LAMBDA to each row and returns an array of the results. For example, if the original array is 3 columns by 2 rows, the returned array is 1 column by 2 rows.
CHOOSECOLSOffice 365+: Returns the specified columns from an array
COLUMNSReturns the number of columns in a reference
COUNTACounts how many values are in the list of arguments
FILTEROffice 365+: Filters a range of data based on criteria you define
IFSpecifies a logical test to perform
IFERRORReturns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula
INDEXUses an index to choose a value from a reference or array
ISERRReturns TRUE if the value is any error value except #N/A
LAMBDAOffice 365+: Use a LAMBDA function to create custom, reusable functions and call them by a friendly name.
LENReturns the number of characters in a text string
LETOffice 365+: Assigns names to calculation results to allow storing intermediate calculations, values, or defining names inside a formula
MMULTReturns the matrix product of two arrays
NAReturns the error value #N/A
NOTReverses the logic of its argument
SEQUENCEOffice 365+: Generates a list of sequential numbers in an array, such as 1, 2, 3, 4
TOCOLOffice 365+: Returns the array in a single column
VSTACKOffice 365+: Appends arrays vertically and in sequence to return a larger array

Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.


Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #48618 for this sub, first seen 3rd Jun 2026, 10:07] [FAQ] [Full list] ^[Contact] [Source code]

1

u/GuerillaWarefare 117 Jun 03 '26

The TOCOL() function has the ability to remove blanks and/or errors. Try

=TOCOL( your_vstack_formula , 3)