Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Insert a variable dependant on content of specific cells


HI

In column C I have a list of reference numbers.

Some of these reference numbers only contain numbers and some contain
numbers and letters.

In column D I need to put a number 3 three for those cells in C which
contain just numbers , and 4 for those cells which contain combined
numbers and letters.

Can some one help with some code for this , please?

Any help appreciated.

Best Wishes
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Insert a variable dependant on content of specific cells

=IF(ISNUMBER(-C1),3,4)
If you are sure that the column C numbers will be real numbers, and not text
that looks like numbers, then you can omit the minus sign.
If you want to add an extra test for column C being blank, you can do that.
--
David Biddulph

"Colin Hayes" wrote in message
...

HI

In column C I have a list of reference numbers.

Some of these reference numbers only contain numbers and some contain
numbers and letters.

In column D I need to put a number 3 three for those cells in C which
contain just numbers , and 4 for those cells which contain combined
numbers and letters.

Can some one help with some code for this , please?

Any help appreciated.

Best Wishes



  #3   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Insert a variable dependant on content of specific cells

Put this in D1 and copy down........

=IF(C1="","",IF(ISNUMBER(C1),3,4))


Vaya con Dios,
Chuck, CABGx3



"Colin Hayes" wrote:


HI

In column C I have a list of reference numbers.

Some of these reference numbers only contain numbers and some contain
numbers and letters.

In column D I need to put a number 3 three for those cells in C which
contain just numbers , and 4 for those cells which contain combined
numbers and letters.

Can some one help with some code for this , please?

Any help appreciated.

Best Wishes

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Insert a variable dependant on content of specific cells


Hi

OK Thanks for your help on this- it's working fine now.

^_^



In article , CLR
writes
Put this in D1 and copy down........

=IF(C1="","",IF(ISNUMBER(C1),3,4))


Vaya con Dios,
Chuck, CABGx3



"Colin Hayes" wrote:


HI

In column C I have a list of reference numbers.

Some of these reference numbers only contain numbers and some contain
numbers and letters.

In column D I need to put a number 3 three for those cells in C which
contain just numbers , and 4 for those cells which contain combined
numbers and letters.

Can some one help with some code for this , please?

Any help appreciated.

Best Wishes


  #5   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Insert a variable dependant on content of specific cells

You're welcome...........thanks for the feedback.

Vaya con Dios,
Chuck, CABGx3



"Colin Hayes" wrote:


Hi

OK Thanks for your help on this- it's working fine now.

^_^



In article , CLR
writes
Put this in D1 and copy down........

=IF(C1="","",IF(ISNUMBER(C1),3,4))


Vaya con Dios,
Chuck, CABGx3



"Colin Hayes" wrote:


HI

In column C I have a list of reference numbers.

Some of these reference numbers only contain numbers and some contain
numbers and letters.

In column D I need to put a number 3 three for those cells in C which
contain just numbers , and 4 for those cells which contain combined
numbers and letters.

Can some one help with some code for this , please?

Any help appreciated.

Best Wishes





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Insert a variable dependant on content of specific cells

In article , CLR
writes
Put this in D1 and copy down........

=IF(C1="","",IF(ISNUMBER(C1),3,4))


Vaya con Dios,
Chuck, CABGx3



Hi

Me again

Suddenly , I find this doesn't work. I did test it out before , and it
seemed to work fine. Now , I'm trying it again in my workbook. It should
return 3 for cells with all numbers , and 4 for cells with numbers and
letters combined. However , it just returns 4 for everything.

This is what I'm using :


=IF(H2="","",IF(ISNUMBER(H2),3,4))


Curiously , if I do a simple test in a blank wb with just a few cells
containing numbers and letters , it works. When I run it in my larger wb
, it doesn't!

Can you advise?

Thanks.



"Colin Hayes" wrote:


HI

In column C I have a list of reference numbers.

Some of these reference numbers only contain numbers and some contain
numbers and letters.

In column D I need to put a number 3 three for those cells in C which
contain just numbers , and 4 for those cells which contain combined
numbers and letters.

Can some one help with some code for this , please?

Any help appreciated.

Best Wishes


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Insert a variable dependant on content of specific cells


Hi

OK please ignore my last post - I managed to work out the problem.

^_^

Best Wishes


In article , Colin Hayes
writes
In article , CLR
writes
Put this in D1 and copy down........

=IF(C1="","",IF(ISNUMBER(C1),3,4))


Vaya con Dios,
Chuck, CABGx3



Hi

Me again

Suddenly , I find this doesn't work. I did test it out before , and it
seemed to work fine. Now , I'm trying it again in my workbook. It should
return 3 for cells with all numbers , and 4 for cells with numbers and
letters combined. However , it just returns 4 for everything.

This is what I'm using :


=IF(H2="","",IF(ISNUMBER(H2),3,4))


Curiously , if I do a simple test in a blank wb with just a few cells
containing numbers and letters , it works. When I run it in my larger wb
, it doesn't!

Can you advise?

Thanks.



"Colin Hayes" wrote:


HI

In column C I have a list of reference numbers.

Some of these reference numbers only contain numbers and some contain
numbers and letters.

In column D I need to put a number 3 three for those cells in C which
contain just numbers , and 4 for those cells which contain combined
numbers and letters.

Can some one help with some code for this , please?

Any help appreciated.

Best Wishes



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
insert cell content and shift cells down Prohock Excel Worksheet Functions 1 May 8th 07 07:32 AM
Sum of Cells if Row Contains a Specific Variable [email protected] Excel Worksheet Functions 2 May 31st 06 05:50 PM
Insert Next? Or insert a variable number of records...how? Tom MacKay Excel Discussion (Misc queries) 0 April 20th 06 10:44 PM
Returning Specific Cell Content using IF Statement weeclaire Excel Discussion (Misc queries) 2 February 17th 06 01:48 PM
Returning Specific Cell Content using IF Statement weeclaire Excel Discussion (Misc queries) 0 February 17th 06 09:25 AM


All times are GMT +1. The time now is 01:26 PM.

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"