in cell D5 change your formula to:

=IF(ISNUMBER(SEARCH("#",C5)),1,0)