array sum based on three conditions

richardg

New Member
Joined
Sep 20, 2006
Messages
2
I've tried searching the board but couldn't find anything. (or maybe I couldn't understand what I found!)

I'm trying to add up hours for employess in a spread sheet based on name, work type (regular, Overtime, etc) , and month. So, I have three array conditions and one to add up.

A B C D
1joe OT 1 8
2joe RE 2 8
3jim RE 1 12
4jim OT 1 8

I tried sum(if(and(A1:A4="joe",B1:B4="OT",C1:C4=1),D1:D4))

any ideas?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Welcome to the board.

=SUMPRODUCT(--(A1:A4="Joe"),--(B1:B4="OT"),--(C1:C4=1),D1:D4)
 
Upvote 0
Hi, welcome to the board!

As a formula, something like this:

=SUMPRODUCT(--(A1:A4="Joe"),--(B1:B4="OT"),--(C1:C4=1),D1:D4)

but since you're summing for all employees, have you tried a Pivot Table?
 
Upvote 0
thanks. formula works.....as you already knew.

My first attempt at pivot table was over this problem so I didn't get very far.

What the heck is -- anyway?
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top