Filter and Search with VSTACK

AkelaWolf76

New Member
Joined
Aug 15, 2023
Messages
10
Office Version
  1. 365
Platform
  1. Windows
I have 2 tables on separate tabs that I would like to search for any row containing a criteria and return the whole row.

After converting the data to tables I create a new tab just for my search and am using cell B3 as my search criteria text box.

I am using the following formula and no matter the search criteria, I get the "No Result" error message returned despite copying the value from one of the table fields in the first place.

=IFERROR(FILTER(VSTACK(Table1[#ALL],Table2),ISNUMBER(SEARCH($B$3,VSTACK(Table1,Table2)))),"No Result")

When I break it down and just use the VSTACK function, this returns a combined table of all data in Table1 & Table2 but as soon as I add the filter function, it errors and the same with the search function.

I have put the formula into gptexcel and the explanation is what I am expecting but cannot get it to work.
"This formula uses the FILTER function to filter a vertical stack of two tables (Table1 and Table2) based on whether a specific text value in cell B3 is found within each row. The ISNUMBER and SEARCH functions are used to check if the text value in B3 is found in each row, and the IFERROR function is used to handle any errors that may occur. If a match is found, the filtered result is returned. If no match is found, the formula returns "No Result""

Any assistance would be greatly appreciated.
 
As you are just using col E try
Excel Formula:
=LET(v,VSTACK(Table1,Table2),FILTER(v,ISNUMBER(SEARCH($B$3,INDEX(v,,5))),"No Result"))
Ideally, I would like to use the search string for any text in any column as we use multiple criteria depending on who is asking the question of us.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Ok, in that case try
Excel Formula:
=LET(v,VSTACK(Table1,Table2),FILTER(v,BYROW(v,LAMBDA(br,SUM(--(ISNUMBER(SEARCH($B$3,br)))))),"No Result"))
 
Upvote 1
Solution
Thanks for that, did you try the formula I suggested in post#8?
yes and that has worked.. although I would need a separate formula for each column.

I feel like we're getting somewhere. Your help is greatly appreciated.
 
Upvote 0
Thanks for that, did you try the formula I suggested in post#8?
yes, and that worked for searching a single column. My larger data set has multiple columns with duplicate data so I would need to search the whole table, not just a single column.

We're getting somewhere and your help is greatly appreciated.
 
Upvote 0
Ok, in that case try
Excel Formula:
=LET(v,VSTACK(Table1,Table2),FILTER(v,BYROW(v,LAMBDA(br,SUM(--(ISNUMBER(SEARCH($B$3,br)))))),"No Result"))
Ding ding ding We have a winner.
You are a life saver!!

I wonder why the original formula didn't work though, there was no reason for it not to surely????
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
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