Spilling Rows in based on another range

tttommy2

Board Regular
Joined
Oct 1, 2012
Messages
60
Office Version
  1. 365
Platform
  1. Windows
I have a range (say "XXX") that is generated by the =SORTBY(FILTER()) function. The number of rows in XXX changes depending on the filter criteria, but the number of columns is fixed.

I also have a second range (say- "YYY") with over 100 columns. I want YYY to have the same number of rows as XXX. Specifically, I'd like YYY to always have the same number of rows as XXX, with the first row of YYY populated and then spilling down to match the number of rows in XXX.

Is there an easy way to do this? Basically the number of rows in YYY follows the no of rows in XXX?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Can you post a small sample of what you have & what you want.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Thank you Fluff.

I wasn't able to install XL2BB. I fiddled around with Trust settings but of no avail. I have attached a screenshot of a much simplified sheet which pretty much captures my issue.

Basically I want the formulas in the top Row of YYY to spill down to match the number of rows in XXX. These formulas are functions of the equivalent row in XXX.

I'm using Excel 365.
 

Attachments

  • Spill.png
    Spill.png
    97.8 KB · Views: 19
Upvote 0
Which cell is the XXX formula in and what cells are YYY?
 
Upvote 0
Sortbt stuff 1.00.xlsx
ABCDEFGHIJKLMNOPQRSTU
7
8Symbol_FilterDONI want the YYY area below to spill down the same no of rows as XXX - (3 Rows for Symbol = "DON")
9
10Raw DataXXXYYY
11SymbolTypeDateRightQuanititySympol ListSymbolTypeDateRightQuanitityDate1B/S
121ASDVV20240524C4ASDDONVV20240524C25024-May-2425000
132ASDVV20240524C-4ARTDONVV20240524C-77
143ASDVV20240524C26BERDONVV20240524C135
154ARTGG20240524C1500DES
165BERGG20240524C6000DON
176DESVV20240524C3FSL
187DESVV20240524C1045FNC
198DESVV20240524C-76GGM
209DESVV20240524C-124GLL
2110DONVV20240524C250INC
2211DONVV20240524C-77MCR
2312DONVV20240524C135MTT
2413FSLVV20250117C300NVV
2514FSLVV20260116C40NGG
2615FSLVV20260116C-14PWW
2716FSLVV20260116C-26PLL
2817FNCVV20240524C2000PGG
2918GGMVV20240531C-1PQQ
3019GGMVV20240607C1RKK
3120GLLVV20240531C-138RNN
3221GLLVV20240531C-1SWW
3322GLLVV20240531C-25SMM
3423GLLVV20240531C11VTT
3524GLLVV20240531C25ZZC
3625GLLVV20240531C100
3726GLLVV20240607C26
3827GLLVV20240607C32
Sheet1
Cell Formulas
RangeFormula
I12:I36I12=UNIQUE(C12:C129)
K12:O14K12=SORTBY(FILTER(C11:G128,((C11:C128=Symbol_Filter)+(C11:C128=uTicker2))*(D11:D128="VV")),FILTER(F11:F128,(C11:C128=Symbol_Filter)*(D11:D128="VV")),1)
Q12Q12=TEXT(M13,"0000-00-00")+22/24
R12R12=O12*100
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Symbol_Filter=Sheet1!$K$8K12
Cells with Data Validation
CellAllowCriteria
K8List=$I$12:$I$56
 
Upvote 0
Thanks for that.
How about
Excel Formula:
=WRAPROWS(TOCOL(IF(SEQUENCE(ROWS(K12#)-1),Q12:R12)),2)
 
Upvote 0
Thank you for your patience Fluff. I assume you put your Excel formula in Cell Q13? If so, it does spill down correctly but it just repeats the values off "Q12:R12" rather than the formulas.

I simplified my sheet further to help illustrate my point.
Sortbt stuff 1.00.xlsx
BCDEFGHIJKLMNOPQR
10Raw DataXXXYYY
11SymbolTypeDateRightQuanititySympol ListSymbolTypeDateRightQuanitityDate1B/S
12ASDVV20240524C4ASDDONVV20240524C25024-May-2425000
13ASDVV20240524C-4ARTDONVV20240524C-7724-May-2425000
14ASDVV20240524C26BERDONVV20240531C13524-May-2425000
15ARTGG20240524C1500DES
16BERGG20240524C6000DON
17DESVV20240524C3FSL
18DESVV20240524C1045FNC
19DESVV20240524C-76GGM
20DESVV20240524C-124GLL
21DONVV20240524C2500
22DONVV20240524C-77
23DONVV20240531C135
24FSLVV20250117C300
25FSLVV20260116C40
26FSLVV20260116C-14
27FSLVV20260116C-26
28FNCVV20240524C2000
29GGMVV20240531C-1
30GGMVV20240607C1
31GLLVV20240531C-138
32GLLVV20240531C-1
33
Sheet1
Cell Formulas
RangeFormula
I12:I21I12=UNIQUE(C12:C129)
K12:O14K12=SORTBY(FILTER(C11:G128,((C11:C128=Symbol_Filter)+(C11:C128=uTicker2))*(D11:D128="VV")),FILTER(F11:F128,(C11:C128=Symbol_Filter)*(D11:D128="VV")),1)
R12R12=O12*100
Q12Q12=TEXT(M13,"0000-00-00")+22/24
Q13:R14Q13=WRAPROWS(TOCOL(IF(SEQUENCE(ROWS(K12#)-1),Q12:R12)),2)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Symbol_Filter=Sheet1!$K$8K12
 
Upvote 0
In that case, for Q12
Excel Formula:
=MAP(INDEX(K12#,,3),LAMBDA(m,TEXT(m,"0000-00-00")+22/24))
and for R12
Excel Formula:
=MAP(INDEX(K12#,,5),LAMBDA(m,m*100))
 
Upvote 0
Solution
Thank you Fluff. This works exactly as I asked. It may be more complex than I was hoping as I have around 100 columns with many complicated and nested functions. I am going to play around with your solution and see how I can implement it. Many thanks. T
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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