Search arrays and add them together to create a new array

Octopus15

New Member
Joined
Oct 23, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Cell A8, C8 and E8 are array formulas which can all vary in length depending on data.
A1 is a table of all of the types possible
K3 and K6 are new criteria I want to join to make a combined array from the individual ones, they are both drop down lists based on the data from table A1

In cell G8 I want to add the two arrays together and get the entire spilled result so I can use it to make a new graph, I can make an Xlookup as shown below but it will not spill the entire array.

=(XLOOKUP(K3,Table3[Type],VSTACK(A8,C8,E8)))+(XLOOKUP(K6,Table3[Type],VSTACK(A8,C8,E8)))

1666540404585.png
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Maybe, in G8:
Excel Formula:
=TEXTSPLIT(TEXTJOIN("|",TRUE,VSTACK(IFERROR(CHOOSE(MATCH(K3,Table3[Type],0),A8#,C8#,E8#),""),IFERROR(CHOOSE(MATCH(K6,Table3[Type],0),A8#,C8#,E8#),""))),,"|")
 
Upvote 0
Solution
@Octopus15, welcome to the Forum!

I interpreted your question the same way as @Anthony47.

Wouldn't it be easier to get your results direct from the dataset, rather than using helper columns for every value in Table3?

ABCDE
1Choice
2Oranges
3OriginalPears
4Data
5Pears103103
6Apples715
7Oranges1516
8Apples811
9Oranges16101
10Oranges11102
11Pears10114
12Apples212
13Pears10213
14Oranges14
15Apples5
16Apples1
17Apples3
18Apples4
19Oranges12
20Oranges13
21Apples6
22
Sheet1
Cell Formulas
RangeFormula
E5:E13E5=FILTER(C5:C21,ISNUMBER(MATCH(B5:B21,Choice,)))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Choice=Sheet1!$E$2:$E$3E5
 
Upvote 0
Maybe, in G8:
Excel Formula:
=TEXTSPLIT(TEXTJOIN("|",TRUE,VSTACK(IFERROR(CHOOSE(MATCH(K3,Table3[Type],0),A8#,C8#,E8#),""),IFERROR(CHOOSE(MATCH(K6,Table3[Type],0),A8#,C8#,E8#),""))),,"|")
Thank you this has worked, I was stuck on the wrong approach
 
Upvote 0
Thank you for the feedback

I was stuck on the wrong approach
The approach was not wrong, but you had to use the expanded A8, C8 and A8 range; I preferred going with CHOOSE & MATCH because that allowed a shorter formula.
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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