Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Conditional formula if content is text

How do i write an IF statement which does Task A if contents of a certain
cell are a TEXT and Task B if it is a numerical value. e.g. If(A1=any
text,1,0) or If(a1=specific text,1,0)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Conditional formula if content is text

If IsNumeric(ActiveCell) Then
'Do Task "B"
Else
'Do Task "A"
End If

"a m spock" wrote:

How do i write an IF statement which does Task A if contents of a certain
cell are a TEXT and Task B if it is a numerical value. e.g. If(A1=any
text,1,0) or If(a1=specific text,1,0)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Conditional formula if content is text

Before using isnumeric see this thread.

You could be surprised.

http://tinyurl.com/9to4ka


Gord Dibben MS Excel MVP


On Sat, 20 Dec 2008 17:13:00 -0800, JLGWhiz
wrote:

If IsNumeric(ActiveCell) Then
'Do Task "B"
Else
'Do Task "A"
End If

"a m spock" wrote:

How do i write an IF statement which does Task A if contents of a certain
cell are a TEXT and Task B if it is a numerical value. e.g. If(A1=any
text,1,0) or If(a1=specific text,1,0)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Conditional formula if content is text

hi
you might try...
formula is......=if(istext(a1),1,0)

regards
FSt1

"a m spock" wrote:

How do i write an IF statement which does Task A if contents of a certain
cell are a TEXT and Task B if it is a numerical value. e.g. If(A1=any
text,1,0) or If(a1=specific text,1,0)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Conditional formula if content is text

Sort of opens a whole new world, doesn't it? Microsoft needs to come up with
an easier way to return data types from a worksheet cell. I am sure that I
am not the only one who struggles with this occasionally.

"Gord Dibben" wrote:

Before using isnumeric see this thread.

You could be surprised.

http://tinyurl.com/9to4ka


Gord Dibben MS Excel MVP


On Sat, 20 Dec 2008 17:13:00 -0800, JLGWhiz
wrote:

If IsNumeric(ActiveCell) Then
'Do Task "B"
Else
'Do Task "A"
End If

"a m spock" wrote:

How do i write an IF statement which does Task A if contents of a certain
cell are a TEXT and Task B if it is a numerical value. e.g. If(A1=any
text,1,0) or If(a1=specific text,1,0)





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Conditional formula if content is text

many thanks. this is the simplest. can you suggest what to do for part 2 of
my question. if for example i have to match to a specific text say,
If(A1=Car,1,0)?

"FSt1" wrote:

hi
you might try...
formula is......=if(istext(a1),1,0)

regards
FSt1

"a m spock" wrote:

How do i write an IF statement which does Task A if contents of a certain
cell are a TEXT and Task B if it is a numerical value. e.g. If(A1=any
text,1,0) or If(a1=specific text,1,0)

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Conditional formula if content is text

hi
i think you already have it. just add quotes to car.

formula is....=if(A1="Car",1,0)......pick your format.

Regards
FSt1

"a m spock" wrote:

many thanks. this is the simplest. can you suggest what to do for part 2 of
my question. if for example i have to match to a specific text say,
If(A1=Car,1,0)?

"FSt1" wrote:

hi
you might try...
formula is......=if(istext(a1),1,0)

regards
FSt1

"a m spock" wrote:

How do i write an IF statement which does Task A if contents of a certain
cell are a TEXT and Task B if it is a numerical value. e.g. If(A1=any
text,1,0) or If(a1=specific text,1,0)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Content linked to other cells formula Content Flawlesgem Excel Discussion (Misc queries) 5 November 21st 08 11:06 AM
Conditional formatting formula that uses VLookup, based on content of another cell Fred Excel Discussion (Misc queries) 2 August 3rd 06 10:38 AM
Conditional formatting formula that uses VLookup, based on content of another cell Fred Excel Discussion (Misc queries) 3 August 2nd 06 04:23 PM
Conditional Formatting if cell content is a formula oldsambvca Excel Worksheet Functions 2 June 6th 06 10:24 PM
formula to extract partial content (text) of cell milano Excel Discussion (Misc queries) 3 November 9th 05 04:57 PM


All times are GMT +1. The time now is 11:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"