close
Hi all,
Does anyone know if there's a way to structure an if statement like:

IF(cell A1 contains a number),show cell A1,leave default FALSE

I've tried wildcards and I can't figure it out. I want to be able to make
this work if any number 0-9 is the first character in the cell, so it would
catch things like:

1
1939
20/20
1024-bit

but not things like:
Route 90
T1000 (I'm a T2 fan, can you tell? )

Thanks a lot!
jezzica85

=IF(ISNUMBER(A1),A1,FALSE)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;jezzica85quot; gt; wrote in message
...
gt; Hi all,
gt; Does anyone know if there's a way to structure an if statement like:
gt;
gt; IF(cell A1 contains a number),show cell A1,leave default FALSE
gt;
gt; I've tried wildcards and I can't figure it out. I want to be able to make
gt; this work if any number 0-9 is the first character in the cell, so it
would
gt; catch things like:
gt;
gt; 1
gt; 1939
gt; 20/20
gt; 1024-bit
gt;
gt; but not things like:
gt; Route 90
gt; T1000 (I'm a T2 fan, can you tell? )
gt;
gt; Thanks a lot!
gt; jezzica85
Bob Phillips wrote

gt; =IF(ISNUMBER(A1),A1,FALSE)
gt;
OP said:
I want to be able to make this work if any number 0-9 is the first
character in the cell,

--
David

I've been playing with this prob and the following formula works although it
is rather long!

=IF(OR(LEFT(A1,1)=quot;1quot;,LEFT(A1,1)=quot;2quot;,LEFT(A1,1)=quot;3 quot;,LEFT(A1,4)=quot;1quot;,LEFT(A1,5)=quot;1quot;,LEFT(A1,6)=quot;1quot;,LEF T(A1,7)=quot;1quot;,LEFT(A1,8)=quot;1quot;,LEFT(A1,9)=quot;1quot;,LEFT(A1, 1)=quot;0quot;),A1,FALSE)

Someone probably has an easier solution though so wait around!

Judith
--
Hope this helpsquot;Davidquot; wrote:

gt; Bob Phillips wrote
gt;
gt; gt; =IF(ISNUMBER(A1),A1,FALSE)
gt; gt;
gt; OP said:
gt; I want to be able to make this work if any number 0-9 is the first
gt; character in the cell,
gt;
gt; --
gt; David
gt;

=ISNUMBER(--LEFT(A1,1))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;Davidquot; gt; wrote in message
...
gt; Bob Phillips wrote
gt;
gt; gt; =IF(ISNUMBER(A1),A1,FALSE)
gt; gt;
gt; OP said:
gt; I want to be able to make this work if any number 0-9 is the first
gt; character in the cell,
gt;
gt; --
gt; David

You could try=IF(OR(LEFT(A1,1)={quot;0quot;,quot;1quot;,quot;2quot;,quot;3quot;,quot;4quot;,quot;5quot;,quot;6quot;,quot;7quot; ,quot;8quot;,quot;9quot;}),quot;yesquot;,FALSE)

and leave the ,False off if you just wish it to default to False.

--JudithJubilee Wrote:
gt; I've been playing with this prob and the following formula works
gt; although it
gt; is rather long!
gt;
gt; =IF(OR(LEFT(A1,1)=quot;1quot;,LEFT(A1,1)=quot;2quot;,LEFT(A1,1)=quot;3 quot;,LEFT(A1,4)=quot;1quot;,LEFT(A1,5)=quot;1quot;,LEFT(A1,6)=quot;1quot;,LEF T(A1,7)=quot;1quot;,LEFT(A1,8)=quot;1quot;,LEFT(A1,9)=quot;1quot;,LEFT(A1, 1)=quot;0quot;),A1,FALSE)
gt;
gt; Someone probably has an easier solution though so wait around!
gt;
gt; Judith
gt; --
gt; Hope this helps
gt;
gt;
gt; quot;Davidquot; wrote:
gt;
gt; gt; Bob Phillips wrote
gt; gt;
gt; gt; gt; =IF(ISNUMBER(A1),A1,FALSE)
gt; gt; gt;
gt; gt; OP said:
gt; gt; I want to be able to make this work if any number 0-9 is the first
gt; gt; character in the cell,
gt; gt;
gt; gt; --
gt; gt; David
gt; gt;--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: www.excelforum.com/member.php...oamp;userid=21059
View this thread: www.excelforum.com/showthread...hreadid=535423Judith,

You got your test value mixed up with the character position after 3

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;JudithJubileequot; gt; wrote in message
...
gt; I've been playing with this prob and the following formula works although
it
gt; is rather long!
gt;
gt;
=IF(OR(LEFT(A1,1)=quot;1quot;,LEFT(A1,1)=quot;2quot;,LEFT(A1,1)=quot;3 quot;,LEFT(A1,4)=quot;1quot;,LEFT(A1,5
)=quot;1quot;,LEFT(A1,6)=quot;1quot;,LEFT(A1,7)=quot;1quot;,LEFT(A1,8)=quot;1quot; ,LEFT(A1,9)=quot;1quot;,LEFT(A1,1)
=quot;0quot;),A1,FALSE)
gt;
gt; Someone probably has an easier solution though so wait around!
gt;
gt; Judith
gt; --
gt; Hope this helps
gt;
gt;
gt; quot;Davidquot; wrote:
gt;
gt; gt; Bob Phillips wrote
gt; gt;
gt; gt; gt; =IF(ISNUMBER(A1),A1,FALSE)
gt; gt; gt;
gt; gt; OP said:
gt; gt; I want to be able to make this work if any number 0-9 is the first
gt; gt; character in the cell,
gt; gt;
gt; gt; --
gt; gt; David
gt; gt;
Thank you Bryan, this works great! And to everyone else, thanks for your
solutions too, I really appreciate it.
Jezzica85

quot;Bryan Hesseyquot; wrote:

gt;
gt; You could try
gt;
gt;
gt; =IF(OR(LEFT(A1,1)={quot;0quot;,quot;1quot;,quot;2quot;,quot;3quot;,quot;4quot;,quot;5quot;,quot;6quot;,quot;7quot; ,quot;8quot;,quot;9quot;}),quot;yesquot;,FALSE)
gt;
gt; and leave the ,False off if you just wish it to default to False.
gt;
gt; --
gt;
gt;
gt; JudithJubilee Wrote:
gt; gt; I've been playing with this prob and the following formula works
gt; gt; although it
gt; gt; is rather long!
gt; gt;
gt; gt; =IF(OR(LEFT(A1,1)=quot;1quot;,LEFT(A1,1)=quot;2quot;,LEFT(A1,1)=quot;3 quot;,LEFT(A1,4)=quot;1quot;,LEFT(A1,5)=quot;1quot;,LEFT(A1,6)=quot;1quot;,LEF T(A1,7)=quot;1quot;,LEFT(A1,8)=quot;1quot;,LEFT(A1,9)=quot;1quot;,LEFT(A1, 1)=quot;0quot;),A1,FALSE)
gt; gt;
gt; gt; Someone probably has an easier solution though so wait around!
gt; gt;
gt; gt; Judith
gt; gt; --
gt; gt; Hope this helps
gt; gt;
gt; gt;
gt; gt; quot;Davidquot; wrote:
gt; gt;
gt; gt; gt; Bob Phillips wrote
gt; gt; gt;
gt; gt; gt; gt; =IF(ISNUMBER(A1),A1,FALSE)
gt; gt; gt; gt;
gt; gt; gt; OP said:
gt; gt; gt; I want to be able to make this work if any number 0-9 is the first
gt; gt; gt; character in the cell,
gt; gt; gt;
gt; gt; gt; --
gt; gt; gt; David
gt; gt; gt;
gt;
gt;
gt; --
gt; Bryan Hessey
gt; ------------------------------------------------------------------------
gt; Bryan Hessey's Profile: www.excelforum.com/member.php...oamp;userid=21059
gt; View this thread: www.excelforum.com/showthread...hreadid=535423
gt;
gt;

Hello,

=ABS(CODE(LEFT(A1,1))-52.5)lt;5

or

=IF(ABS(CODE(LEFT(A1,1))-52.5)lt;5,quot;yesquot;,quot;noquot;)

HTH,
Bernd
arrow
arrow
    全站熱搜

    software 發表在 痞客邦 留言(0) 人氣()