Vstack/Filter Function Help

Arts

Well-known Member
Joined
Sep 28, 2007
Messages
770
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi all

I have used the VSTACK/FILTER across two sheets and this has for the most part done what I require, (Great function by the way!)

Now the issue I am having is how to use the filter function with this in main the second aspect of the filter function in what to include.

I have used the formula =VSTACK(Sheet2!B4:C18,Sheet3!B4:C18)

But this has returned me results with "0"'s.

I cannot seem to exclude the 0 with this in my result. I did see online to include FILTER with this to remove the zero but with the example they had used the VSTACK function was used holding shift (3D Reference??) allowing them to edit the range to not include 0 but I seem unable to do this when selecting the the range from two sheets.

I did try the below but this seems to return back a VALUE Error

=FILTER(VSTACK(Sheet2!B4:C18,Sheet3!B4:C18),(VSTACK(Sheet2!B4:C18,Sheet3!B4:C18)<>""


ID-01Project 1
ID-02Project 2
ID-03Project 3
ID-04Project 4
ID-05Project 5
ID-06Project 6
ID-07Project 7
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
ID-101Project 101
ID-102Project 102
ID-103Project 103
ID-104Project 104
ID-105Project 105
ID-106Project 106
ID-107Project 107
ID-108Project 108
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​

As always any help on this is appreciated.

* whist my profile says 2016 I using 365 at work
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How about
Excel Formula:
=LET(v,VSTACK(Sheet2!B4:C18,Sheet3!B4:C18),FILTER(v,INDEX(v,,1)<>""))
 
Upvote 0
Solution
How about
Excel Formula:
=LET(v,VSTACK(Sheet2!B4:C18,Sheet3!B4:C18),FILTER(v,INDEX(v,,1)<>""))

Perfect, works amazingly!

I assume there is no way to edit the range any other way in the second aspect of the FILTER? (Include aspect) I only say this as to learn what you provided seems quite complex!

Was hoping for a slight variation of my earlier failed formula
 
Upvote 0
If you want it like the formula you posted it would need to be
Excel Formula:
=FILTER(VSTACK(Sheet2!B4:C18,Sheet3!B4:C18),VSTACK(Sheet2!B4:B18,Sheet3!B4:B18)<>"")
 
Upvote 0
If you want it like the formula you posted it would need to be
Excel Formula:
=FILTER(VSTACK(Sheet2!B4:C18,Sheet3!B4:C18),VSTACK(Sheet2!B4:B18,Sheet3!B4:B18)<>"")

Thank you so much for this!

Another follow up (apologies) in this instance the formula you provided works as both ranges are in the same columns within separate sheets, how would I do this say if my ranges were to be in different columns when using the VSTACK (hope what I'm saying makes sense) example below

=FILTER(VSTACK(Sheet2!B4:C18,Sheet3!C4:D18) (how would I exclude the 0's in this instance using the second solution you provided)
 
Upvote 0
Use the first option, it's easier. :)
 
Upvote 0
Use the first option, it's easier. :)

Haha (easier if you have Fluff like jedi excel skills!) I'll go over the first option (again) you provided and see if I can decipher, thanks once again for you help with this.
 
Upvote 0
All it does is store the vstack in a variable & then filters that based on the 1st column.
 
Upvote 0
All it does is store the vstack in a variable & then filters that based on the 1st column.

Appreciate the explanation! When ever I have used the filter function I have never seen it used with LET and INDEX so assumed it complex as soon as I saw it. Will take it away, something to do over the weekend....
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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