You can use a ternary operator to assign check text and assign color value as follows.
$('tr').each(function () {
var cell =$(this).find('td').eq(4);
var color=cell.text().trim() == "yes"?"Green":"Red";
cell.css('background', color);
}
});
Let me know if this helps.
Regards,
Adil Shaikh