Does anyone know if there is a way to use the if function to search for
comma's within a cell. For instance, in the below, using the if
function, I've tried the below without success.
if(A1=quot;,quot;,quot;Flagquot;,quot;Unflagquot;)
It's obviously wrong...I'd greatly appreciate if someone can lend me a
hand. Seems simple enough but can't figure it out._Column_A__
Row 1 EMERGING MARKETS
Row 2 KINNUNEN, JUHA
Row 3 POSEN, DAVID
Row 4 HORTON, WILLIAM--
spirosu
------------------------------------------------------------------------
spirosu's Profile: www.excelforum.com/member.php...foamp;userid=7442
View this thread: www.excelforum.com/showthread...hreadid=513762Use the FIND( ) function, as follows:
=IF(FIND(quot;,quot;,A1),quot;Flagquot;,quot;Unflagquot;)
Hope this helps.
Pete=if(isnumber(search(quot;,quot;,a1)),quot;flagquot;,quot;unflagquot;)
or
=if(countif(a1,quot;*,*quot;)gt;0,quot;flagquot;,quot;unflagquot;)
spirosu wrote:
gt;
gt; Does anyone know if there is a way to use the if function to search for
gt; comma's within a cell. For instance, in the below, using the if
gt; function, I've tried the below without success.
gt;
gt; if(A1=quot;,quot;,quot;Flagquot;,quot;Unflagquot;)
gt;
gt; It's obviously wrong...I'd greatly appreciate if someone can lend me a
gt; hand. Seems simple enough but can't figure it out.
gt;
gt; _Column_A__
gt; Row 1 EMERGING MARKETS
gt; Row 2 KINNUNEN, JUHA
gt; Row 3 POSEN, DAVID
gt; Row 4 HORTON, WILLIAM
gt;
gt; --
gt; spirosu
gt; ------------------------------------------------------------------------
gt; spirosu's Profile: www.excelforum.com/member.php...foamp;userid=7442
gt; View this thread: www.excelforum.com/showthread...hreadid=513762
--
Dave Peterson
You can use the following IF, which uses the find function to look for your
comma. The find function returns an integer value indicating what character
position the character you're looking for was found in, if it is not found
find returns a zero (0).
=IF(FIND(quot;,quot;,A1,1)gt;0,quot;Flagquot;,quot;Unflagquot;)
--
Kevin Backmannquot;spirosuquot; wrote:
gt;
gt; Does anyone know if there is a way to use the if function to search for
gt; comma's within a cell. For instance, in the below, using the if
gt; function, I've tried the below without success.
gt;
gt; if(A1=quot;,quot;,quot;Flagquot;,quot;Unflagquot;)
gt;
gt; It's obviously wrong...I'd greatly appreciate if someone can lend me a
gt; hand. Seems simple enough but can't figure it out.
gt;
gt;
gt; _Column_A__
gt; Row 1 EMERGING MARKETS
gt; Row 2 KINNUNEN, JUHA
gt; Row 3 POSEN, DAVID
gt; Row 4 HORTON, WILLIAM
gt;
gt;
gt; --
gt; spirosu
gt; ------------------------------------------------------------------------
gt; spirosu's Profile: www.excelforum.com/member.php...foamp;userid=7442
gt; View this thread: www.excelforum.com/showthread...hreadid=513762
gt;
gt;
Thanks for the ultra fast response everyone! Working like a charm now.
Spiro--
spirosu
------------------------------------------------------------------------
spirosu's Profile: www.excelforum.com/member.php...foamp;userid=7442
View this thread: www.excelforum.com/showthread...hreadid=513762
Is it your aim just to establish whether the cell contains a comma, or
do you want to do something with that information?
Perhaps there's a better way to achieve your ultimate objective.
btw, as you may have noticed
=FIND(quot;,quot;,A1) will give a #VALUE! error if A1 doesn't contain a comma
my suggestion, which returns TRUE (if there is a comma) or FALSE if
not
=FIND(quot;,quot;,A1amp;quot;,quot;)lt;=LEN(A1)--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=513762
- Jan 24 Wed 2007 20:35
if statements, searching for commma
close
全站熱搜
留言列表
發表留言