Taking all matches from multiple criteria search into different columns or taking n'th match into specific column

Biana

New Member
Joined
Mar 25, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
The simplified version of what I need to solve for is shown below. I work in Excel Tables. In the example below one customer order might include several items. I need to rearrange for the output tables the data so that each order has 1 line and the different products purchased are shown in different columns. The multiple criteria which need to be answered for is that Order # matches and that the Line:Type needs to be "Line Item". I have tried combinations of Index/Small/If functions but it didn't work with Excel Tables. Could anyone help me please?



1648254327886.png
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Would you consider using a VBA program?
maybe, though i know close to 0 in vba. Also would it be possible to have though results still in the table? Or then using VBA we extract that data to another sheet and then link it to my output table already?
 
Upvote 0
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFG
1
21Line Itema1ab
31Line Itemb2f
41c3ik
51d
62e
72Line Itemf
82g
92h
103Line Itemi
113j
123Line Itemk
133l
14
Data
Cell Formulas
RangeFormula
E2:E4E2=UNIQUE(FILTER(A2:A100,B2:B100="Line Item"))
F2:G2,F4:G4,F3F2=TRANSPOSE(FILTER($C$2:$C$100,($A$2:$A$100=E2)*($B$2:$B$100="Line Item")))
Dynamic array formulas.
 
Upvote 0
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFG
1
21Line Itema1ab
31Line Itemb2f
41c3ik
51d
62e
72Line Itemf
82g
92h
103Line Itemi
113j
123Line Itemk
133l
14
Data
Cell Formulas
RangeFormula
E2:E4E2=UNIQUE(FILTER(A2:A100,B2:B100="Line Item"))
F2:G2,F4:G4,F3F2=TRANSPOSE(FILTER($C$2:$C$100,($A$2:$A$100=E2)*($B$2:$B$100="Line Item")))
Dynamic array formulas.
Fluff, thank you! Your solution does solve the simplified example, however, I found a better solution which worked for me just now. Yours is simpler as a formula and I actually didn't know FIlter function, so thanks for that as well. However, it does force the result column to be following one after another. The solution provided below will be taking n'th repetition only and hence will allow me to organise columns as I wish (ie I would have Product 1, then product 1 price, then product 1 quantity etc instead to be grouping them like product 1, product 2, etc and so on). I appreciate I didn't mention those specifications in the question and you solved for the example provided.

The solution for me was the following:
=IFERROR(INDEX($C$2:$C$13,SMALL(IF(($A$2:$A$13=$E2)*($B$2:$B$13="Line Item"),ROW($A$2:$A$13)-ROW(INDEX($A$2:$A$13,1,1))+1),2))," ") -array formula, where bolded 2 is the n'th repetition, so can be changed to 1 for product 1, to 2 for product 2, etc
 
Upvote 0
Solution
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

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