newbe qustion

O

oren

Hi All, i have a newbe question ...
I need to write a function that will do like this :
lets assume : A1 = 30/01/1991

the function : if (A1 is smaller then 01/01/1980 then put 111), if (A
is smaller than 01/01/1990 then put 222, if non of the above put 999)

Can someone help ?

thnx ...

Oren :confused
 
G

Guest

One option to consider would be to use VLOOKUP instead of IF for this.
If you typed a list of relevant dates--something like this:
0 999
1/1/1900 111
1/1/1980 222
1/1/1990 999

in some available cells (I used G1:H4 in my sample), then you could write
this Formula:
=VLOOKUP(A1,$G$1:$H$4,2,1)
You will need the 0 value for the formula to account for values less than
1/1/1980.

tj
 
M

Mark

Hi,
Dates are hard to manipulate but try this (put the
function in A2):
cell B1 = 01/01/1980
cell C1= 01/01/1990

=IF(A1<B1,111,IF(A1<C1,222,999))


or this:

=if(abs("A1")< abs("B2"),111,if(abs("A1")< abs
("C1"),222,999))

make sure the target cell is formatted to general.


- Mark
 
G

Guest

I need to correct myself here-I meant to edit before I sent it:
1/1/1900 111
1/1/1980 222
1/1/1990 999

tj
 

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