You need to "wrap" your formula with a test for the error like this:
=IF(ISNA(your formula),0,your formula)
The most common #N/A comes from VLOOKUP() results without a match, so you
might have a formula like this:
=VLOOKUP(A1,B1:J99,3,FALSE)
and you would rewrite it as
=IF(ISNA(VLOOKUP(A1,B1:J99,3,FALSE)), 0, VLOOKUP(A1,B1:J99,3,FALSE))