View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default SUM function Help Please

i did have a typo in the original post, but didn't correct it because the op
changed their request

=SUMIF(B1:Z1,"="&B1&"",B3:Z4)-SUMIF(B1:Z1,""&E1&"",B3:Z4)
s/b
=SUMIF(B1:Z1,"="&B1&"",B3:Z3)-SUMIF(B1:Z1,""&E1&"",B3:Z3)

--


Gary


"JMB" wrote in message
...
Assuming your data is in A1:E5 (names in A2:A5, dates in B1:E1, and hours are
in B2:E5) and A11=Tom, B11=11/2/7, C11=11/4/7, you could try:

=SUMPRODUCT((A2:A5=A11)*(B1:E1=B11)*(B1:E1<=C11)* B2:E5)

or given the same assumptions about the location of the data, I'm not
completely following why the following Sumif suggestion does not work for you
(as Gary originally recommended). If addition rows are added/deleted from
your table, XL will update this formula accordingly. The only problem will
be if you type another name over "Tom" or copy/paste "Tom" to another
location in the table (instead of cut/paste - which would work fine). Also,
I believe the sumif statement will calculate faster.

=SUMIF(B1:E1,"="&B11,B3:E3)-SUMIF(B1:E1,""&C11,B3:E3)


"nicolairob" wrote:

Hi,
I am having problems with summing some data with multiple criteria. It
appears that SUMIF will not work due to all ranges required to be the same
size and shape.
Example:

"HOURS WORKED"

(A) (B) (C) (D)
(E)

1. 11/1/07 11/2/07 11/3/07
11/4/07

2. Mary 8.0 4.5 6.0
3.5

3. Tom 7.0 2.5 3.0
6.0

4. Cindy 3.5 8.0 9.0
7.0

5. Rob 4.0 5.5 6.5
8.0


Calculation: I need to know the total hours Tom worked from 11/2/07 -
11/4/07.
Please Help and thanks so much,
Rob