=SUMIF(A2:A100,21,B2:B100)
Sum of the values in B2:B100 WHERE the corresponding rowID in A2:A100 is 21 (Assuming 21 is numeric)
If the 21 is not numeric then it must be enclosed in quotes within the formula, eg
=SUMIF(A2:A100,"21",B2:B100)
If you have a list of IDs in your spreadsheet in say cells J1:J5, and you wish to use this formula against each of those IDs in the list, then you can substitute the 21 or "21" for a cell reference, so in say K1 simply put the formula
=SUMIF(A$2:A$100,J1,B$2:B$100)
and then copy down to K5. Note that the row part of the references have been made absolute with the use of the $ signs so that they don't change when you copy down.
If this doesn't help either then you need to give an example of your data, state what you want to get out of it, and give us the answer you would expect from the data you provide.
If you wish to sum on more than one criteria then investigate the SUMPRODUCT function in Help.
Regards
Ken..............
----------------------------------------------------------------------------
![[peace] [peace] [peace]](/data/assets/smilies/peace.gif)
It's easier to beg forgiveness than ask permission
![[2thumbsup] [2thumbsup] [2thumbsup]](/data/assets/smilies/2thumbsup.gif)
----------------------------------------------------------------------------