# array sum based on three conditions

#### richardg

##### New Member
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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Welcome to the board.

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

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?

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?

Replies
9
Views
346
Replies
3
Views
875
Replies
2
Views
108
Replies
11
Views
510
Replies
8
Views
243

1,216,175
Messages
6,129,300
Members
449,499
Latest member
HockeyBoi

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

### Which adblocker are you using?

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

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