VSTACK - can it combine specific columns of data

usnapoleon

Board Regular
Joined
May 22, 2014
Messages
112
Office Version
  1. 365
Platform
  1. Windows
I have a VSTACK formula that I utilize elsewhere and I want to see if it can be adapted for something slightly different. Typically it combines consecutive columns of data, which is what my current formula does. But on my new desired adapted use, I want to pick specific columns to pull data. Is this possible?

Here is an image of what it's doing right now, which you can laugh at the obvious 'not working as intended'

1737512078069.png


I do want it to pull column B, from the tabs 1-31, but I dont want B-W, I want B, L, R, T, and (this one may be tricky) the numerical sum of columns S less T

Can I make the VSTACK picky like that?

Here's the current formula I have. I didnt make it myself, I think I got it from someone else's spreadsheet in the past.

=LET(Data,VSTACK('1:31'!$B$23:$W$72),column1,TAKE(Data,,1),output,FILTER(Data,column1<>0,""),output)

I normally try to understand what the formula is saying... try to verbalize out loud it into something anyone could understand, and that helps me understand formulas and break them down and make edits to them in the future (like now), but I can't follow it starting with 'column1,TAKE(Data....etc etc'. Consequently I cant edit it myself.

Thank you
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
The TAKE(data,,1) is grabbing the first column, then filter where it's not 0.
To choose more than 1 column, try replace the TAKE with in CHOOSECOLS(data,1,2,5) to choose column 1,2 and 5 (for example).
 
Last edited:
Upvote 0
The TAKE(data,,1) is grabbing the first column, then filter where it's not 0.
To choose more than 1 column, try replace the TAKE with in CHOOSECOLS(data,1,2,5) to choose column 1,2 and 5 (for example).

Hi Cubist! Good seeing you again!

I made the edit:

=LET(Data,VSTACK('1:31'!$B$23:$W$72),column1,CHOOSECOLS(Data,1,11,17,19),output,FILTER(Data,column1<>0,""),output)

is this how you wanted me to edit it? I did the intended columns, with B being column 1, and providing the numerical equivalent for columns B, L R, and T. I know I want columns S and T to be S minus T (so column 18 minus 19) but I figure it's best to get this working before I try to figure out that fanciness.

The result of the above formula came back with a #VALUE, so I know I am doing something wrong. At the bare minimum I hope I edited the right parts! It was showing the number appropriately 333 initially, as shown in my first posting.
 
Upvote 0
Try:
Excel Formula:
=LET(Data,CHOOSECOLS('1:31'!$B$23:$W$72,1,11,17,19),output,FILTER(Data,INDEX(Data,,1)<>0,""),output)
 
Upvote 0

Forum statistics

Threads
1,225,738
Messages
6,186,736
Members
453,369
Latest member
juliewar

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