Data Validation with Formula

I think I posted this in the wrong place earlier....sorry for the confusion

Straigtforward question here....I know how to use data validation and I know how to use formulas. From what I understand data validation will only work with data directly entered into the cell. Is there anyway to get data validation to work with the result of a formula? For example I want a cell to record the number of times the number "1" is entered into a range. I'll use the countif function in the cell specifying the range and the criteria (being the number "1"). I then add the data validation to that cell wanting it to give me an error message when the count exceeds (say 5) in that cell. When the formula result exceeds 5 nothing happens. Is there anyway to get around this or will I need to settle for color coding the cell or something like that?

Thanks for your time.
Greg

re: data validation with formula

Instead of data validation, I would just use an IF formula, on the order of:

=IF(COUNTIF(range_name,1)>5,"TOO MANY",COUNTIF(range_name,1))

My apologies if this has been answered and I missed it; I am new to the site.