View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ian
 
Posts: n/a
Default need to know how to get the sum of right product returned

If I understand correctly, you want to multiply the number of fish by the
wieght and categorise the total weight by individual fish weight. It's not
clear what you want to do with a fish weighing exactly 4, so I've assumed
3-4 includes 4.

I've assumed your data as posted occupies A1:D4

In C2
=IF(AND(B23,B2<=4),A2*B2,0)
Copy down the column
In D2
=IF(AND(B24,B2<5),A2*B2,0)
Copy down the column
At the bottom of columns C & D, sum the cells above eg
In C101
=SUM(C2:C100)
In D101
=SUM(D2:D100)

--
Ian
--
"farmer" wrote in message
...
sorry i had to fix a number here - its ok now

" fish number fish weight sum3-4 sum 4-5
31457 3.5
45367 4.5
34289 3.5

sum 3-4 should return sum of the two rows with between 3 and 4 (230111)
and sum 4-5 shold return sum sum of the row with 4.5 (204151)