Excel_Blonde
New Member
- Joined
- Aug 8, 2018
- Messages
- 44
Hi all,
I'm very new to excel queries and was wondering if i'd better off using VBA for what I'm trying to achieve?
Also are queries the same as power query? Is power query an add in? (Like I say I'm very new)
Essentially, I'm trying to combine worksheets into one Master workbook and then use conditions to return a list into another worksheet within the same Master workbook.
So far I have managed to create a query which imports all data sheets within a specified folder. I've managed to set it to automatically refresh upon loading (including any new worksheets).
Now what I need to do is to drill down further, hopefully the below table will help to explain.
If the unique identifier2 appears 3 times with different unique identifier1's and Names I would it to list into sheet2. List all entries meeting this criteria.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Unique Identifier 1[/TD]
[TD]Unique identifier 2[/TD]
[TD]Unique identifier 3[/TD]
[TD]P1[/TD]
[TD]P2[/TD]
[TD]A1[/TD]
[TD]A2[/TD]
[/TR]
[TR]
[TD]Order1[/TD]
[TD]Op1[/TD]
[TD]Unpeel[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]Order1[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Order2[/TD]
[TD]Op1[/TD]
[TD]Unpeel[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Order2[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Order3[/TD]
[TD]Op1[/TD]
[TD]Wash[/TD]
[TD]Apple[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]5[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Order3[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Apple[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Order4[/TD]
[TD]Op1[/TD]
[TD]Unpeel[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]4[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]Order4[/TD]
[TD]Op2[/TD]
[TD]Slice[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]Order4[/TD]
[TD]Op3[/TD]
[TD]Test[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Order5[/TD]
[TD]Op1[/TD]
[TD]Wash[/TD]
[TD]Orange[/TD]
[TD]4[/TD]
[TD]8[/TD]
[TD]5[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]Order5[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Order5[/TD]
[TD]Op3[/TD]
[TD]Unpeel[/TD]
[TD]Orange[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]4[/TD]
[TD]9[/TD]
[/TR]
</tbody>[/TABLE]
Note. The number of ops can change for the same unique identifier, e.g one order for banana can have 2 ops but another can have 3 ops.
I hope this makes sense.
I'm very new to excel queries and was wondering if i'd better off using VBA for what I'm trying to achieve?
Also are queries the same as power query? Is power query an add in? (Like I say I'm very new)
Essentially, I'm trying to combine worksheets into one Master workbook and then use conditions to return a list into another worksheet within the same Master workbook.
So far I have managed to create a query which imports all data sheets within a specified folder. I've managed to set it to automatically refresh upon loading (including any new worksheets).
Now what I need to do is to drill down further, hopefully the below table will help to explain.
If the unique identifier2 appears 3 times with different unique identifier1's and Names I would it to list into sheet2. List all entries meeting this criteria.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Unique Identifier 1[/TD]
[TD]Unique identifier 2[/TD]
[TD]Unique identifier 3[/TD]
[TD]P1[/TD]
[TD]P2[/TD]
[TD]A1[/TD]
[TD]A2[/TD]
[/TR]
[TR]
[TD]Order1[/TD]
[TD]Op1[/TD]
[TD]Unpeel[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]Order1[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Order2[/TD]
[TD]Op1[/TD]
[TD]Unpeel[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Order2[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Banana[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Order3[/TD]
[TD]Op1[/TD]
[TD]Wash[/TD]
[TD]Apple[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]5[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Order3[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Apple[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Order4[/TD]
[TD]Op1[/TD]
[TD]Unpeel[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]4[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]Order4[/TD]
[TD]Op2[/TD]
[TD]Slice[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]Order4[/TD]
[TD]Op3[/TD]
[TD]Test[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Order5[/TD]
[TD]Op1[/TD]
[TD]Wash[/TD]
[TD]Orange[/TD]
[TD]4[/TD]
[TD]8[/TD]
[TD]5[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]Order5[/TD]
[TD]Op2[/TD]
[TD]Test[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Order5[/TD]
[TD]Op3[/TD]
[TD]Unpeel[/TD]
[TD]Orange[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]4[/TD]
[TD]9[/TD]
[/TR]
</tbody>[/TABLE]
Note. The number of ops can change for the same unique identifier, e.g one order for banana can have 2 ops but another can have 3 ops.
I hope this makes sense.