如果列A包含相同的姓氏多于一个,则如何在列B中添加值? [英] How do I add values in column B if column A contains the same employee surname more than once?
问题描述
数据状态:我有A列,其中有雇员姓名,B列有数小时。如果列A包含相同的员工姓氏多于一次,我如何添加小时?
State of Data: I have column A which has names of employes and column B has number of hours. How do I add the hours if column A contains same employee surname more than once?
我一直在使用我预期的工作,下面的公式im使用应该工作但是我不明白为什么它不是?
I have been using what I expected to have worked, the following Formula im using should work, but I dont understand why it isnt?
公式: = SUMIF($ A $ 2:$ B $ 79,A2,$ B $ 2:$ B $ 79)
显然我有79行的数据,所以我将把公式下钻到其他单元格,为什么我没有锚定 A2
。
Obviously I have 79 rows worth of data, so I'll be drilling down the formula to the other cells, which is why i haven't anchored A2
.
那么我在这里做错了什么?有效的计算方法?
So what am I doing wrong here?, is there a better more efficient way of calculating this?
添加信息,例如,如果我在A栏中有一个名为 Richard
,他的名字已经出现在列A
3倍的值在列B
as 3,4,9
所以我想在列D里总共列出Richards的名字,例如说他已经做了共16小时
。
Added Info: for example if I have an employee in column A who goes by the name of Richard
, his name has appeared in column A
3 times values are in column B
as 3,4,9
So I would like to have a total in column C with Richards name in column D for example stating that he has done a total of 16 hours
.
推荐答案
公式只需要一点调整
列出D列中的员工,并将列表中的C / p>
List the employees in column D, and drill this formula down column C
=SUMIF($A$2:$A$79,D2,$B$2:$B$79)
SumIf的工作原理就是这样 - 首先,你把你要搜索的范围,然后是你要查找的项目,然后最后您希望加入的范围。
SumIf works like this - first, you put the range you are searching, then the item you are looking for, and then finally the range you wish to add together.
资源 - http://office.microsoft.com/en-gb/excel-help/sumif-HP005209292.aspx
Resource - http://office.microsoft.com/en-gb/excel-help/sumif-HP005209292.aspx
这篇关于如果列A包含相同的姓氏多于一个,则如何在列B中添加值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!