test text string for a comma (,)
=if(isnumber(search(a1&" ",",")),"has comma", "no comma")
(a1&" " will avoid "has comma" when A1 is empty)
=if(countif(a1,"*,*")0,"has comma","no comma")
is another way.
=len(a1)-len(substitute(a1,",",""))
will return the number of commas in A1
JR Hester wrote:
Excel XP on WinXP
Inherited a spreadsheet from another user. Have a mixture of lname, fname
and fname lname combinations. I can successfully convert the lname, fname to
fname lname, teh problem is those cells that are already in the fname lname
return a #Value error.
I thought I could find a way to logically test the string for a comma(,) and
use an If statement to control my concatenate formula. I can't find a way to
test logically for the comma.
Can anyone offer a solution?
Thank you
--
Dave Peterson
|