简体   繁体   中英

Excel - Lookup multiple values in unknown columns and create bar chart out of it

I am trying to get the following thing to work in Excel. I have a list of values out of which I want to create a bar chart. Easy thing normally, but in this special case I do not know how to get it to work with references that change. I have the data structured as follows:

Name    Site    Value
---------------------
A       X       1
---------------------
B       Y       2
---------------------
G       Z       3
---------------------
D       Z       0
---------------------
F       X       1
---------------------
Q       Y       2
---------------------

From the information available in this array I want to create three different bar charts, one per site. The problem is that I don't know the absolute cell references, as the data is inserted by colleagues. In addition, the number of datapoints to display is not known either. In case there a three different entries for one site, I want to display a bar chart with these three values, the names of the entries should be used as the label for the bars in the chart. In case there are four different entries, I want to display a bar chart with four bars, etc... This whole table should be dynamic, so in case that a new entry is added to the range with the corresponding site, it should be automatically included in the bar chart.

I already tried to find a workaround for this and read about dynamic charts and lookup functions in excel, but nothing did the trick so far. If you have any idea, please let me know. Thanks in advance :)

What I would suggest is:

Create 3 Pivot Tables. The data source for each of them would be: A:C (the whole columns). This way, when an entry is added, you just update the tables and they get in.

Column "Site" should be added as a filter, then on one Pivot Table you would filter only for site X, another for site Y and the other for site Z.

Now, "Name" go on Rows and Value go on Values.

Now, for each Pivot Table you add a bar chart.

I think this solves your issue.

Here'a a screen showing it. My excel is in PT-BR but I think you can get the general idea.

SS

Edit: you can also put the same scale on all 3 charts, so you can easily compare the values.

Thanks to both of you guys and sorry for the late reply. In the end I got it working with pivot tables, though I had to fiddle a bit with the pivot table wizard, as I wanted to display values from multiple sheets. Thanks again and best regards :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM