# does not mean null, it means it has a value of Not Assigned. This is not a number value, so trying to convert it to number will likely result in an error, which is what you are seeing.
One option is to either do a check to see if there was an error, or you can do a check for # and replace its value with 0 instead.