Insert a variable dependant on content of specific cells

C

Colin Hayes

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
 
D

David Biddulph

=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.
 
C

CLR

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

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


Vaya con Dios,
Chuck, CABGx3
 
C

Colin Hayes

CLR said:
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.
 
C

Colin Hayes

Hi

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

^_^

Best Wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top