I'm not seeing the function ReturnNAIfEmpty called in either of these rules.
For the first one, change this line:
cell.Content = FormatGenericTagged(column.Format, data.GetFieldValue(r, column.Field));
to
cell.Content = FormatGenericTagged(column.Format, ReturnNAIfEmpty(data.GetFieldValue(r, column.Field)));
For the second one, I think this is just the format rule, not the data rule. I'd need to see the data rule.