Help

  • Thread starter Thread starter O....
  • Start date Start date
O

O....

I have two columns Company Name and # of Hours.

Name # of hours
Company A 8
Company A 10
Company B 5
Company A 2
Company B 3

I Need to Sum Company A and B Hours, I tried SumProduct, but I Can't Get
it...

Help...Thanks in Advance
 
With your posted data in A1:B6

Try this:

D2: Company A
D3: Company B

This formula returns the total for the company entered in Col_D :
E2: =SUMIF($A$2:$A$6,D2,$B$2:$B$6)
Copy E2 into E3

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
hi
sumif???
=sumif(A1:A10,"Company A",B1:B10)

you would need a sumif for each company.

regards
FSt1
 
Assuming your database is A1..B100...

....for Company A,
=SUMPRODUCT(($A$2:$A$100="Company A")*($B$2:$B$100))

....and for Company B
=SUMPRODUCT(($A$2:$A$100="Company B")*($B$2:$B$100))

When I do problems like this in real life, I usually make a list of what I'm
trying to calculate for in a separate area of the worksheet and use cell
references in the formulas. So in your example, I might use columns D & E,
list all the companies starting in D2, then in E2, write my formula as

=SUMPRODUCT(($A$2:$A$100=D2)*($B$2:$B$100))

D E
1 Name Total Hrs
2 Company A
3 Company B

It is then a simple task to copy this formula from E2 down to the row of the
last company.
 
Back
Top