How to spill a second column from the spill formula in one cell? (two-dimensional spill :) ?)

Rnkhch

Well-known Member
Joined
Apr 28, 2018
Messages
528
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a filter function in D1 that spills the contents of column A that match the filter criteria. I was wondering if it is possible to have the formula in the same cell spill the content of the adjacent column (B) in column E? In the attached example, I have manually filled in the contents of column B in E right next to each cell of the spill, but I was hoping that can be done in one step automatically 😁

(I was thinking to use INDEX/MATCH to grab the column B content separately, but it won't work where there are multiple numbers in column A that are the same.)

Thanks for any input!


Book1
ABCDEF
112u37f
237f32h
332h49z
416o43g
549z48h
68f24r
743g23t
848h46j
918f50l
1024r
1123t
1217y
1346j
1419k
1550l
16
Sheet1
Cell Formulas
RangeFormula
D1:D9D1=LET(x,A1:A15,FILTER(x,x>20))
Dynamic array formulas.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Maybe just use the FILTER function.
Book1
ABCDE
112u37f
237f32h
332h49z
416o43g
549z48h
68f24r
743g23t
848h46j
918f50l
1024r
1123t
1217y
1346j
1419k
1550l
Sheet1
Cell Formulas
RangeFormula
D1:E9D1=FILTER(A1:B15,A1:A15>20,"No Data")
Dynamic array formulas.
 
Upvote 0
Awesome! Thank you. I was overthinking :biggrin:

One more thing. If a cell in column B is blank, then the spill shows a zero instead of blank for that spot. How do I avoid that?
 
Upvote 0
One more thing. If a cell in column B is blank, then the spill shows a zero instead of blank for that spot. How do I avoid that?
Maybe this way...
Excel Formula:
=FILTER(""&A1:B15,A1:A15>20,"No Data")
 
Upvote 0
If you want to maintain the column A values as numbers not text in the result, perhaps

Excel Formula:
=LET(rw,A1:A15>20,CHOOSE({1,2},FILTER(A1:A15,rw),FILTER(B1:B15&"",rw)))
 
Upvote 0
Another way to maintain the numbers as such

22 07 20.xlsm
ABCDE
112u37f
237f32h
332h49z
416o43
549z48h
68f24r
74323
848h46j
918f50l
1024r
1123
1217y
1346j
1419k
1550l
Filter
Cell Formulas
RangeFormula
D1:E9D1=LET(f,FILTER(""&A1:B15,A1:A15>20),IFERROR(f+0,f))
Dynamic array formulas.
 
Upvote 0
Solution
Argh, I never noticed that my formula in Message #4 outputted Column A values as text.

If you don't mind having your results sorted by the Column A values, then this formula should also work to preserve Column A values as numbers...
Excel Formula:
=LET(x,A1:B15,SORT(IF((A:A x)>20,IF(x="","",x),"")))
 
Upvote 0
If you don't mind having your results sorted by the Column A values, then this formula should also work ..
.. providing also that the spill range is not going to be used elsewhere as that produces a spill range as big as the original range rather than just the minimum required number of rows.
 
Upvote 0
My take on this: Since one cannot not know in advance how many rows will meet the stated criteria, I think the spill range should always be as large as the original range (for a calculation such as this one) so that no one can put data in any part of it without raising a Spill error to alert them. That way, if the range gets bigger due to a change in the original data, the other data you referred to won't have to be moved out of the way to make way for the increased spill's output range.
 
Upvote 0
Yes, but if that formula was in say N1 then another formula might use N1# in it somewhere and that would drag in all 15 rows, including any blanks at the bottom which could result in errors or no error but incorrect/misleading results in that other formula.
 
Upvote 0

Forum statistics

Threads
1,214,867
Messages
6,122,002
Members
449,059
Latest member
mtsheetz

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