Try this: def FindLabel ([cis12DCE],[cis12DCE_Ex]): if int([cis12DCE_Ex]) == 1: return "<clr red = '255'>"+"cis-1,2-Dichloroethylene "+str([cis12DCE])+"</clr>" else: return "cis-1,2-Dichloroethylene "+str([cis12DCE])