饼图每周更换一次

时间:2016-06-30 07:57:54

标签: excel excel-vba excel-formula vba

我有一个每周一周的图表,其中包含有多少小时,9人正在工作的信息。是否有可能将其变成每周饼图,自动显示当前周和每个人工作的总小时百分比,即工作量饼图自动更新到当前周。

Current graph

What I want

数据来自日历,每个人每个项目每周都按小时计算。 From this calendar

我甚至不知道如何开始使用代码,因此我没有饼图的任何代码。

这是当前年度概览图设置graph for hours a week for every person

的方式

这是小时=SUMIFS(Calendarsheet!L4:L262;Calendarsheet!$B4:$B262;Calendarsheet!$B4)的公式 我将名字存储在B栏

graph of percent of their max hours 此图表中的公式:=B34/Calendarsheet!L$3它从第一个图表中获取小时数,并除以从日历表中获取的该周的总工作时间

抱歉链接不好,需要更多声望才能发布超过2个链接

1 个答案:

答案 0 :(得分:0)

If I got you correctly then you want to extract one column from the calendar each time and present it in a pie chart. So first make an assisting column that will depend on a value stored in a specific cell (say U2), then create a pie chart using that column, and every time you will update the cell U2 your pie chart will update.

For the assisting column you will need =LOOKUP($U$2,$B$2:$S$2,B5:U5) where $B$2:$S$2 is the row with the week numbers and B5:S5 is the hours for the person in row 5. You then do this for all persons in the table. Finally you create a pie chart based on this column.

Here you can see the LOOKUP() formula in it's place: Assisting column

And here the range selected to produce the pie chart (A4:A12&V3:V12): Dynamic Pie chart

Hope it helps ;)