Function to convert array to Range

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
751
Office Version
  1. 365
Platform
  1. Windows
i have a table with 2500 rows, 20 columns. i use filter(table25, table25[colX]="Y") and it returns the table filtered on Y, but I dont need all the columns so i delete some. I cant do that with an array so I select the range and do a copy, 'paste as values'. But wondering if there is a function i can wrap the filter in so it does the conversion in 1 step.

i tried ArrayToText(Filter(....) ) but i get a !CALC error... but removing the ArrayToText returns the array properly
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
This sort of thing?

ilcaa.xlsm
ABCDEFGHIJ
1ABCDEADE
2afkYpaYp
3bglNqcYr
4chmYrdYs
5dinYs
6ejoNt
7
Sheet1
Cell Formulas
RangeFormula
H2:J4H2=FILTER(FILTER(Table1,Table1[D]="Y"),COUNTIF(H1:J1,Table1[#Headers]))
Dynamic array formulas.
 
Upvote 0
Do you have the CHOOSECOLS function available?
 
Upvote 0
It could be like this.

ilcaa.xlsm
ABCDEFGHIJ
1ABCDEADB
2afkYpaYf
3bglNqcYh
4chmYrdYi
5dinYs
6ejoNt
Sheet1
Cell Formulas
RangeFormula
H2:J4H2=CHOOSECOLS(FILTER(Table1,Table1[D]="Y"),1,4,2)
Dynamic array formulas.
 
Upvote 0
Solution
Also, if you might add/delete/reorder table columns in the original table, you can instead use the headings that you are interested in like this and the results will automatically update in the mentioned circumstances.

ilcaa.xlsm
ABCDEFUVWX
1ABCDEADB
2afkYpaYf
3bglNqcYh
4chmYrdYi
5dinYs
6ejoNt
7
Sheet1
Cell Formulas
RangeFormula
V2:X4V2=CHOOSECOLS(FILTER(Table1,Table1[D]="Y"),MATCH(V1:X1,Table1[#Headers],0))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,226,269
Messages
6,189,950
Members
453,583
Latest member
Ok_category1816

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