ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help (https://www.excelbanter.com/excel-discussion-misc-queries/176436-help.html)

O....

Help
 
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

Ron Coderre

Help
 
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)

"O...." wrote in message
...
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





FSt1

Help
 
hi
sumif???
=sumif(A1:A10,"Company A",B1:B10)

you would need a sumif for each company.

regards
FSt1

"O...." wrote:

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


Mike H

Help
 
Try

=SUMPRODUCT((A1:A5="Company A")*(B1:B5))


Mike

"O...." wrote:

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


MrAcquire

Help
 
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.

"O...." wrote:

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



All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com