If a comma is found

T

T. Valko

Another one:

=IF(COUNT(FIND(",",A1)),.....

Note that this doesn't work on numbers using a number comma format (10,000)
 
J

Joerg Mochikun

Assumes that A1 contains text:
=IF(ISERROR(FIND(",",A1)),"comma not found","comma found")

Joerg
 
R

Rick Rothstein

Here is another approach...

=IF(LEN(A1)=LEN(SUBSTITUTE(A1,",","")),"No comma","There's a comma")
 
R

Rick Rothstein

I like this one best... one function call. Let's remove the comparison just
to shorten it up a bit...

=IF(COUNTIF(A1,"*,*"),"found","not found")
 
D

Dave Peterson

I find using the comparison self-documenting.

Rick said:
I like this one best... one function call. Let's remove the comparison just
to shorten it up a bit...

=IF(COUNTIF(A1,"*,*"),"found","not found")
 
R

Rick Rothstein

That is true enough (but I would guess doing introduces an extra, albeit
very quick, calculation to the formula).

--
Rick (MVP - Excel)


Dave Peterson said:
I find using the comparison self-documenting.
 
D

Dave Peterson

I think it makes the formula easier to understand -- especially for the posters
who are asking this type of question.

And it may make it easier to use the function in different formulas.



Rick said:
That is true enough (but I would guess doing introduces an extra, albeit
very quick, calculation to the formula).
 
Top