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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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