PDA

View Full Version : [SOLVED:] Combining Counts and Sum from two columns



spittingfire
09-11-2015, 08:31 AM
Hi All,

I have the attached test data and I am trying to achieve the results in column D.

I have the already grouped by Emp_ID (column A) and what I want to do is to have a formula written that will look at the Emp_ID in column A and if the IDs are the same, total up the corresponding totals in column B and put the resulting Sum into column D.

I have manually entered a few results in column D to show what I am looking for and how I want the data in the column to be presented.

Thanks in advance for all your help.

Paul_Hossler
09-11-2015, 08:43 AM
A pivot table might be easier and more flexible

1436914370

dxider
09-11-2015, 09:01 AM
Well, this formula is what you need to put on D:

=IF(A2<>A1,SUM(OFFSET(B2,0,0):OFFSET(B2,MATCH(A2+1,A:A,1)-ROW(),0)),"")

This fomula goes on B2, you only have to drag it to bottom cells and the cells will change accordingly.

spittingfire
09-11-2015, 09:07 AM
Thanks dxider that certainly solves my issue. Thanks Paul_Hossler as well for the pivot table option which also works as well.