|Is that what you need?|
This will return a 3 if A1 contains 1, a 1 if A1 contains 3 and a blank cell if A1 contains anything other than 1 or 3.
Drag this down (or across) to apply to your "block of cells". (I'm not quite sure what you mean by a "block of cells" so I can't be any more specific than that.)
All you need to do after that is to SUM all of the cells that contain the formulas.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.