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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,010
Office Version
  1. 365
Welcome to the board.

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

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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?
 

richardg

New Member
Joined
Sep 20, 2006
Messages
2
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?
 

Forum statistics

Threads
1,136,370
Messages
5,675,367
Members
419,566
Latest member
moni2277

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
Top