Think I need an Array; not sure

H

heyredone

I think I need an Array to get what I want, but I'm not sure how to write it.
I get part way then am at a loss. Worksheet is formatted as:

A: First Name
B: Last Name
C: Badge #
D-Z: [dates & hours worked calculations]
AA: MORE THAN 5 HRS (with IF calculations resulting in "1" for true or "0"
for false)
AB: LESS THAN 10 HRS (with IF calculations resulting in "1" for true or "0"
for false)
AC to AI: (similar hours increments)

Employee #1 has 8 rows of data due to the dates he worked (A2:A9), employee
#2 has 21 rows of data (A10:A30), employee #3 (A31:A 111)

I need to count how many times "1" appears in AA2:AA9 for employee #1,
number of times "1" appears in AA10:AA30 for employee #2, etc.

Is it an Array that I really need or something else? Thanks for any help
one can provide.
 
S

Sheeloo

=SUMPRODUCT(--(C1:C1000=C1),--(AA1:AA1000=1))

will give you the sum of those cells in AA1:AA1000 which have 1 in them and
in the same row Col C equals the value in C1...

In other words it will sum Col AA for the rows for employee# 1 if C1
contains 1...

Genral form is
=SUMPRODUCT(--(rng1=cond1),--(rng2=cond2),(rng3))

rng1, 2, and 3 have to be of same size..
-- converts the TRUE to matches to 1 and FALSE to 0 so it essentially
multiples rng1 (1 or 0) with rng2 (1 or 0) and rng3 (actual value) and sums
up.

As you must have realized if you have -- in front of all conditions it acts
as COUNIF
and if you don't have it front of one set it acts as SUMIF...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top