XLOOKUP multiple items from one column, returning CHOOSECOLS

Vcoppens

Board Regular
Joined
Apr 16, 2012
Messages
96
Office Version
  1. 365
Platform
  1. Windows
Hi,

From about 30000 rows and 50 columns, I need to extract data based on multiple numbers from one particular column, called TYPE.

There are about 20 different types, and I only need to extract types 1 - 3 - 5 and 7.

My formula works perfectly well when I look up, for example, number 1.

=xlookup(A1,F:F,choosecols(A:BD,1,5,2,20,27,17,21,34,19)

However, when I lookup the array with TYPE numbers from 1 through 7, I get a #SPILL! error.

Lookup the array of numbers in column F.

1
3
5
7

The result would return a compacted table:

NumberNameAmountOriginal AmountDatePercentage

If anyone has a suggestion, I would greatly appreciate it.

Thank you!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Alex had an extra bracket, try
Excel Formula:
=FILTER(CHOOSECOLS(A:BD,1,5,2,20,27,17,21,34,19),ISNUMBER(MATCH(F:F,{1,3,5,7},0)),"")
Thank you so very much to all of you for helping me out.

This worked like a charm. Thank you Alex for setting us on the right path.

Thank you, thank you!

1736296127793.png
 
Upvote 0

Forum statistics

Threads
1,225,317
Messages
6,184,250
Members
453,223
Latest member
Ignition04

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