Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Sort Data in a Bar Chart

Posted on 2012-03-20
Medium Priority
354 Views
I have a bar chart where I want to show how many people answered a question with possible answers A, B, C, D. I can use a table to generate this in excel.
``````
A	B	C	D
1	15	15	10	10
2	20	20	5	5
3	5	15	20	10
4	7	3	30	10
5	10	13	7	20
6	20	5	5	20
7	15	10	10	15
8	15	8	5	22
9	10	5	25	10
10	3	10	5	30
``````
Is there any way to sort the order of the displayed results such that if B is the "Correct" answer that it will be the first result so the row has B, A, C, D etc.
Basically I want to push the correct total to the front.
0
Question by:stopher2475
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 4
• 2

LVL 33

Expert Comment

ID: 37744217
One option would be to use a separate data table for the graph, ordering the columns in the correct order.

The data table would be formula driven:

G     H
1      B
2  1    =vlookup(\$G2,\$A\$1:\$E\$12,MATCH(H\$1,\$A\$1:\$E\$1,0),FALSE)
3  2
4  3

This would lookup the value of column 1 (1 - 10) and match the value in row 1 (A - D) in the table. If the column "Headers" are then in the relevant order, the data will effectively be sorted for the graph.

If you upload a sample, I can put it in place in a sample.

Thanks
Rob H
0

LVL 33

Expert Comment

ID: 37744264
Sample was easy to copy from question.

See attached. Change headers in H1:K1.

Thanks
Rob H
Sort-Chart.xls
0

LVL 2

Author Comment

ID: 37744846
Sorry. I don't think I was clear. There is the possibility that any of the 4 letters is the correct answer and if so I'd like to get it to the beginning of the bar chart. Not sure if this is possible in Excel.
0

LVL 33

Expert Comment

ID: 37745041
Put the letters in the required order across the top and the relevant scores will be displayed in the formula table below, thus putting the scores in the "correct" order.

By beginning of the bar chart, I assume you mean the series that starts at zero; the furthest left.

Rob H
0

LVL 33

Accepted Solution

Rob Henson earned 2000 total points
ID: 37745054
Ahhh!  Do you mean that the correct answer for each question could be different and thus needing the correct answer for each question to be first and not all questions as a whole??

I think that's still possible but you would need a correct answer for each question specified somewhere.

See attached.
Sort-Chart.xls
0

LVL 2

Author Closing Comment

ID: 37745479
I think you're as close as it's gonna get. The system the client used for their other reporting did it a little differently but required a lot more development.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaacâ€¦
###### Suggested Courses
Course of the Month12 days, 1 hour left to enroll