Problem with Sections and Index match

Heltony

New Member
Joined
Jul 31, 2023
Messages
3
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
Hi, I have a Input sheet where only the qty changes, there are 6 sections with varying row numbers (between 5 and 50), I can bring the changes to the qty onto the results sheet with index match but it clumps the results together, is there a way of splitting the results up into there sections, I have hopefully provided a sheet showing this.

Book1.xlsx
ABCDEFGHIJK
1This is the input sheet only the Qty changes
2PRODUCT PART NUMBERQuantityUnit PriceI can get these results with index match
3Section 1item 111111
4item 22222Quote Sheet
5item 333313PRODUCT PART NUMBERQuantityUnit Price
6item 111111
7Section 2Item 14445item 333313
8Item 255526Item 255526
9Item 36667Item 3999411
10
11Section 3Item 17779By Adding the section number and a qty into the product line I can get
12Item 288810PRODUCT PART NUMBERQuantityUnit Price
13Item 3999411Section 11
14item 111111
15item 333313
16Section 21
17Item 255526
18Section 31
19Item 3999411
20
21Is there anyway I can get
22PRODUCT PART NUMBERQuantityUnit Price
23Section 1
24item 111111
25item 333313
26
27Section 2
28Item 255526
29
30Section 3
31Item 3999411
Sheet1
Cell Formulas
RangeFormula
H6:K9H6=IFERROR(INDEX($B$3:$E$13,SMALL(IF((INDEX($B$3:$E$13,,3)>= 1),MATCH(ROW($B$3:$E$13),ROW($B$3:$E$13)),""),ROWS($B$2:B2)),COLUMNS($B$2:B2)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 

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.
Welcome to the MrExcel board!

Is this what you mean?

23 08 06.xlsm
ABCDEFGHIJK
1
2PRODUCT PART NUMBERQuantityUnit PricePRODUCT PART NUMBERQuantityUnit Price
3Section 1item 111111Section 1
4item 22222item 111111
5item 333313item 333313
6
7Section 2Item 14445Section 2
8Item 255526Item 255526
9Item 36667
10Section 3
11Section 3Item 17779Item 3999411
12Item 288810
13Item 3999411
14
Sections
Cell Formulas
RangeFormula
H4:K5,H11:K11,H8:K8H4=LET(F,MATCH(H3,A:A,0),L,MATCH(TRUE,INDEX(B:B,F):B1000="",0)-1,d,INDEX(B:B,F):INDEX(E:E,F+L),FILTER(d,INDEX(d,0,3)<>"",""))
Dynamic array formulas.
 
Upvote 0
Welcome to the MrExcel board!

Is this what you mean?

23 08 06.xlsm
ABCDEFGHIJK
1
2PRODUCT PART NUMBERQuantityUnit PricePRODUCT PART NUMBERQuantityUnit Price
3Section 1item 111111Section 1
4item 22222item 111111
5item 333313item 333313
6
7Section 2Item 14445Section 2
8Item 255526Item 255526
9Item 36667
10Section 3
11Section 3Item 17779Item 3999411
12Item 288810
13Item 3999411
14
Sections
Cell Formulas
RangeFormula
H4:K5,H11:K11,H8:K8H4=LET(F,MATCH(H3,A:A,0),L,MATCH(TRUE,INDEX(B:B,F):B1000="",0)-1,d,INDEX(B:B,F):INDEX(E:E,F+L),FILTER(d,INDEX(d,0,3)<>"",""))
Dynamic array formulas.
Hi Peter_SSs
Thanks for the prompt reply, your formula works really well to bring the items from the input page but could it bring all the items and section headers without having to identify each section separately on the results page as some of the sections have 50 items or more which could end with the results spilling over,
It's a much better way than my attempt, could I put the section headers above each set of items and bring them across with the items, I could always hide them, I think I'm asking to much for a gap between sections but could your formula bring all the sections and headers, I'm not averse to adding columns if needed, I will try to adapt it myself but I'm pretty sure you stand a much better chance,
thanks Peter_SSs for your help.
 
Upvote 0
Could you remove the merged cells in column A and do it like this?

23 08 06.xlsm
ABCDEFGHIJK
1
2PRODUCT PART NUMBERQuantityUnit PriceSECTIONPRODUCT PART NUMBERQuantityUnit Price
3Section 1item 111111Section 1item 111111
4Section 1item 22222Section 1item 333313
5Section 1item 333313
6Section 2Item 255526
7Section 2Item 14445
8Section 2Item 255526Section 3Item 3999411
9Section 2Item 36667
10
11Section 3Item 17779
12Section 3Item 288810
13Section 3Item 3999411
14
Sections (2)
Cell Formulas
RangeFormula
G3:K8G3=LET(d,A3:INDEX(E:E,LOOKUP("zzz",A1:A1000,SEQUENCE(1000))),z,FILTER(d,(INDEX(d,0,4)<>"")+(INDEX(d,0,1)=""),""),IF(z="","",z))
Dynamic array formulas.
 
Upvote 0
Solution
Hi Peter_SSs,
Awesome, that's perfect, I would have never got there on my own, thank you so much.
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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