Mark
Mark

Reputation: 4873

Excel Formula - Conditional - Highlight Cell if Char Count > 160

Apparently Stackoverflow does allow question on excel formulas, so I will give this a shot. Hopefully I'm not down voted too quickly.

I'm creating an excel file, on one column I am expecting user input. This column "should" have a max-char count of 160. I want this cell highlight if the user input is greater than this amount.

JS Pseudo Example:

var x = $(this).val().length;

if(x>160){
 $(this).css("background","red");
}

Upvotes: 0

Views: 102

Answers (1)

pnuts
pnuts

Reputation: 59475

Select the relevant column and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::

=LEN(  

enter the reference to your mystery column

1)>160

Format..., select colour Fill (highlight) of your choice, OK, OK.

However, as noted by @Scott Holtzman, where convenient it is generally better to block bad data than to accept and highlight it.

Upvotes: 1

Related Questions