Consolidate results from database query

inwoodpcpro

New Member
Joined
May 16, 2011
Messages
1
I'm new to the forums here. Could not find what I'm looking for. If this was answer in a previous post, please point me there.

I have data on an excel sheet that was pulled from a database. There is a record for each question in a test along with the choices of the test. Problem is there are 5 records for each question, one for each choice.

I would like to pull out the choices and make then a column instead of a row.

I dont see a way to attach a file on this forum. On some posts it looks like people make the table right in the post. ANy ideas how I can do that so i can show my sample?

Basically I have the results like this
The columns are:

Test, Test Name, Question Number, Question Text, Choice, Choice Text

1 Test1 1 Question 1 A Choice A
1 Test1 1 Question 1 B Choice B
1 Test1 1 Question 1 C Choice C
1 Test1 1 Question 1 D Choice D
1 Test1 1 Question 1 E Choice E
1 Test1 2 Question 2 A Choice A
1 Test1 2 Question 2 B Choice B
1 Test1 2 Question 2 C Choice C
1 Test1 2 Question 2 D Choice D
1 Test1 2 Question 2 E Choice E

should end up something like this

Test, Test Name, Question Number, Question Text, Choice A, Choice Text, Choice B, Choice Text, Choice C, Choice Text, Choice D, Choice Text, Choice E, Choice Text

1 Test 1 1 Question 1 A Choice A B Choice B C Choice C D Choice D E Choice E
1 Test 1 2 Question 2 A Choice A B Choice B C Choice C D Choice D E Choice E

Hope that makes sense to someone. Thanks!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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