Need help with Query formula

zazybang

New Member
Joined
May 6, 2018
Messages
23
I have lots of data one one spreadsheet, the goal is to make a query formula that will search for all the responses a person made based on a cells critera. EX:
Sheet 1
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name:[/TD]
[TD]Response:[/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]Y[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Y[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Z[/TD]
[TD]F[/TD]
[/TR]
</tbody>[/TABLE]

Sheet 2
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Query Formula[/TD]
[TD]Criteria (name): X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The Query formula searched for all responses made by X on sheet 1 then places them on Sheet 2. How would I make such a formula?
 

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.
I have lots of data one one spreadsheet, the goal is to make a query formula that will search for all the responses a person made based on a cells critera. EX:
Sheet 1
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name:[/TD]
[TD]Response:[/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]Y[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Y[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Z[/TD]
[TD]F[/TD]
[/TR]
</tbody>[/TABLE]

Sheet 2
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Query Formula[/TD]
[TD]Criteria (name): X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The Query formula searched for all responses made by X on sheet 1 then places them on Sheet 2. How would I make such a formula?

Is the result you're looking for like this?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Query Formula[/TD]
[TD]Criteria (name): X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


or this:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Query Formula[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]A,C,D[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Y[/TD]
[TD]B,E[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Z[/TD]
[TD]F[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Is the result you're looking for like this?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Query Formula[/TD]
[TD]Criteria (name): X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


or this:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Query Formula[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]A,C,D[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Y[/TD]
[TD]B,E[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Z[/TD]
[TD]F[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I like both, could by chance send me both formulas?
 
Upvote 0
Is the result you're looking for like this?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Query Formula[/TD]
[TD]Criteria (name): X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]X[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Actually, ill just take this one ^ thanks btw!
 
Upvote 0
The first would just be an index/match formula, in the above example, using Query Formula as A1, and the data is on sheet named 'Data', with Name being A1

=index(Data!A:A, match(a2,data!B:B,0))

let me get a few thing sfinished and i will post the other formula, you just need to concatenate, but i need coffee before using that many commas.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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