if function

  • Thread starter Thread starter neilb514
  • Start date Start date
N

neilb514

Hi
I need to do a basic if function. in cell A1 it may say "14" so in cell A2 I
want to display another number ie "1", If A1 has changed to "18" I want A2 to
display "2", If A1 changes again I need to display "3" etc. I need five
changes all told, and I havn't got a clue. Any help will be appretiated.
 
Are they specific sets of numbers? I mean will A1 contain only ever 14, 18
......whatever the rest of the numbers are or do you mean *ANY* change of A1
index A2 up one. If the former then try:

=IF(A1=14,1,IF(A1=18,2,IF(A1=22,3,IF(A1=26,4,IF(A1=30,5,"")))))

or if you mean "up to 14", "more then 14 and up to 18" then try:

=IF(A1>26,5,IF(A1>22,4,IF(A1>18,3,IF(A1>14,2,IF(A1>0,1,"")))))

If you mean *any* change then you will need VBA.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
Glad that it worked for you. Thanks for the feedback.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
Back
Top