View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
nicolairob nicolairob is offline
external usenet poster
 
Posts: 6
Default SUM function Help Please

Gary,
That works great as long as I do not sort rows on "Sheet 1." If I insert
rows, the name range will move accordingly, but if I sort names in alpha
order for example, it remains constant regardles of whose name is in column
A. I need it to give me "Toms" hours even if I sort rows.
Thank you so much for helping me with this!
Rob

"Gary Keramidas" wrote:

ok, on sheet1, name the range B3:Z3 Tom, and do the same for every other name

then try this formula in column d on sheet2

=SUMIF(Sheet1!B1:Z1,"="&A1&"",INDIRECT(C1))-SUMIF(Sheet1!B1:Z1,""&B1&"",INDIRECT(C1))

--


Gary


"nicolairob" wrote in message
...
Hi Gary,
Yes, the dates were in B1:Z1. However, on a separate worksheet "Sheet 2" I
will have the date 11/2/07 in (A1) and 11/4/07 in (B1). Employee names in
(C1) In (D1), I want the calculation from "Sheet 1" as presented below:
I want to know how many hrs Tom(A3) worked from 11/2/07 - 11/4/07 (C3:E3)
Now, I have to link to the name "Tom" and not the cell, as new entries on
that sheet will shift his name accordingly. Also, when I change the dates in
"Sheet 2 (A1) and (B1), it will need to provide that time range summation in
(D1).
Thanks,
Rob


"Gary Keramidas" wrote:

may be a simpler way, but would something like this work for you?

=SUMIF(B1:Z1,"="&B1&"",B3:Z4)-SUMIF(B1:Z1,""&E1&"",B3:Z4)


i assumed dates were in B1:Z1 and you wanted the totals from B1 to E1

--


Gary


"nicolairob" wrote in message
...
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