Thread: SUMIf
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer bpeltzer is offline
external usenet poster
 
Posts: 180
Default SUMIf

If I understand correctly, it seems like you're trying to do the work for
Excel by identifying which rows to add up. But that's exactly what the sumif
function can do for you.
Try =SUMIF('96-97'!$A:$A,'Lost days'!$A2,'96-97'!$B:$B)
That says to look for values that match 'Lost days'$A2 in all of column A on
sheet '96-97' and, where found, add the corresponding values from column B.
So wherever you see Bert in column A, add the values from column B.
--Bruce


"Sojo" wrote:

I have a worksheet titled lost days that look like this:

A B C D
1 Name 96-97 97-98 98-99
2 Bert
3 oscar
4 elmo
5 elmo
6 maria


Then a 96-97 worksheet (i have one for each year begining 96 -2004) with :

A B C D
1 Name Lost time Age Gender
2 elmo 2
3 elmo 0
4 Bert 1
5 Bert 36
6 ernie 0
7 big bird 0
8 oskar 0

I want to sum the total of lost days per person from the yearly worksheets
and enter it under the respective year int he lost days worksheet. For
example, I want know who may days did Bert lose in 96-97. I I thought I
could use sumif, but I'm the problem is I don't know how to tell it to sum
the colum B of rows that where it found the name Bert. I know $ make it
always do colum B, but what symbol do I use to say "from the rows the
correspond with the name (criteria)"? For Bert the formula would be:

=SUMIF('96-97'!A2:A36,'Lost days'!A2,'96-97 SIF'!$B4:$B5)

That would not work for anyone else as the row for their data are different

=SUMIF('96-97'!A2:A36,'Lost days'!A2,'96-97 SIF'!$B?:$B?).

Help