=SUMPRODUCT(--(E4:AH4<>""),--(F4:AI4=""))+(AI4<>"")
Notice how the ranges are "staggered": (E4:AH4<>"") (F4:AI4="")
This works! But, could you explain in plain english what this is doing?
SUMPRODUCT in the help section is used to sum an array of cells, but the
above is all on one row. What do these do "--"? I appreciate the help!
thanks!
>> =SUMPRODUCT(--(A2:AD2<>""),--(B2:AE2=""))+(AE2<>"")
>> I tried: =SUMPRODUCT(--(E2:AI2<>""),--(E4:AI4<>""))+(AI4<>"")
[quoted text clipped - 70 lines]
>>>>>
>>>>> thanks!
T. Valko - 13 Dec 2006 21:23 GMT
Even though all the data is in 1 row we've created 2 arrays by staggering
the references:
A1 B1 C1
......B1 C1 D1
Basically, all this is doing is testing a series of 2 cells. It tests 1 cell
to see if it is not empty then it tests the cell next to it to see if it is
empty. Where those 2 conditions are TRUE the "--" converts the TRUE to a 1
and where those 2 conditions are FALSE the "--" converts the FALSE to a 0.
Then Sumproduct justs adds up all the 1's and 0's to arrive at the result.
I just thought of something. What if a person misses Friday and the
following Monday? Is that a single instance or is that 2 instances? If
that's considered 2 instances then there's no problem. If that's considered
1 instance then the formula will count that as 2 instances. One way to fix
that is to enter something (anything, like a "x") in the cells for Saturday
and Sunday.
Biff
> =SUMPRODUCT(--(E4:AH4<>""),--(F4:AI4=""))+(AI4<>"")
> Notice how the ranges are "staggered": (E4:AH4<>"") (F4:AI4="")
[quoted text clipped - 78 lines]
>>>>>>
>>>>>> thanks!