Remember Me?

#1
July 31st 09, 07:34 PM posted to microsoft.public.excel.misc
 external usenet poster First recorded activity by ExcelBanter: Apr 2009 Posts: 18
Distinguish Letters vs. Numbers in an IF Statement

I need to write an IF statement so that if the contents of a cell are a
letter do one thing, it they are a number do another.

How do I distinguish between the two in an IF statement?

Thanks,

W. Wolfe

#2
July 31st 09, 07:46 PM posted to microsoft.public.excel.misc
 external usenet poster First recorded activity by ExcelBanter: Apr 2007 Posts: 11,501
Distinguish Letters vs. Numbers in an IF Statement

Hi,

Try this

=IF(ISNUMBER(A1),"Do number things",IF(NOT(ISBLANK(A1)),"Do text things","Do
neither, it's blank"))

Mike

"William Wolfe" wrote:

I need to write an IF statement so that if the contents of a cell are a
letter do one thing, it they are a number do another.

How do I distinguish between the two in an IF statement?

Thanks,

W. Wolfe

#3
July 31st 09, 07:46 PM posted to microsoft.public.excel.misc
 external usenet poster First recorded activity by ExcelBanter: Jul 2006 Posts: 5,651
Distinguish Letters vs. Numbers in an IF Statement

On Fri, 31 Jul 2009 14:34:04 -0400, "William Wolfe"
wrote:

I need to write an IF statement so that if the contents of a cell are a
letter do one thing, it they are a number do another.

How do I distinguish between the two in an IF statement?

Thanks,

W. Wolfe

=if(isnumber(cell_ref),"do this","do that")
--ron
#4
July 31st 09, 07:48 PM posted to microsoft.public.excel.misc
 external usenet poster First recorded activity by ExcelBanter: Aug 2008 Posts: 5,934
Distinguish Letters vs. Numbers in an IF Statement

Use the ISNUMBER function...

=IF(A1="","I'm blank",IF(ISNUMBER(A1),"I'm a number","I'm text"))

--
Rick (MVP - Excel)

"William Wolfe" wrote in message
...
I need to write an IF statement so that if the contents of a cell are a
letter do one thing, it they are a number do another.

How do I distinguish between the two in an IF statement?

Thanks,

W. Wolfe

#5
July 31st 09, 08:11 PM posted to microsoft.public.excel.misc
 external usenet poster First recorded activity by ExcelBanter: Apr 2009 Posts: 18
Distinguish Letters vs. Numbers in an IF Statement

W. Wolfe

"Rick Rothstein" wrote in message
...
Use the ISNUMBER function...

=IF(A1="","I'm blank",IF(ISNUMBER(A1),"I'm a number","I'm text"))

--
Rick (MVP - Excel)

"William Wolfe" wrote in message
...
I need to write an IF statement so that if the contents of a cell are a
letter do one thing, it they are a number do another.

How do I distinguish between the two in an IF statement?

Thanks,

W. Wolfe

#6
July 18th 19, 07:49 PM
 Junior Member First recorded activity by ExcelBanter: Jul 2019 Posts: 1
Great answers thank you, I have a question relating to this.

I have been searching for something like this but with a twist.

What if you have numbers and letters in the cell. is there a way to tell it to show just the letters or the numbers as the answer???

thank you

PS: I did not want to start a whole new thread, I will hopefully get the answer here.
if not I will start one another time.

 Posting Rules Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On

 Similar Threads Thread Thread Starter Forum Replies Last Post Peta Excel Worksheet Functions 0 February 2nd 09 09:02 AM Brian Ballek Excel Worksheet Functions 7 August 7th 07 01:37 AM Gunny Excel Discussion (Misc queries) 5 July 16th 06 01:22 AM phaidon New Users to Excel 2 April 12th 06 09:42 AM cxlough41 Excel Discussion (Misc queries) 11 January 4th 06 02:16 AM

All times are GMT +1. The time now is 08:57 AM.