Hi,

Select E3:N3, in CF,

=COLUMNS($E$3:E3)<=$B$3 ===> format green

=COLUMNS($E$3:E3)>$B$3 ===> format red