View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Aaron Hodson \(Coversure\) Aaron Hodson \(Coversure\) is offline
external usenet poster
 
Posts: 46
Default IF formula help - incorporate greater than & smaller than

Thanks Paul & Pete,
Noticed when I was testing that I forgot a number!
Works fine,
I had a look at the 'roundup' option and it works great, but decided against
for the present time, as it is easier for me to read 'if' functions as a
relative beginner (this may sound odd).

Thanks


"PCLIVE" wrote in message
...
Correction to last formula
=IF(P7=0,1,IF(P7<1,2,IF(P7<2,3,IF(P7<3,4,IF(P7<4,5 ,IF(P74,6,0))))))

The change involved the number six at the end.

To do the formula the way you explained by testing between the two values,
you could use:
=IF(P7=0,1,IF(AND(P70,P7<1),IF(AND(P7=1,P7<2),3,I F(AND(P7=2,P7<3),4,IF(AND(P7=3,P7<4),5,IF(P74,6,0 ))))))

Regards,
Paul

--

"PCLIVE" wrote in message
...
If you will not have any values less than zero, then one way:

=IF(P7=0,1,IF(P7<1,2,IF(P7<2,3,IF(P7<3,4,IF(P7<4,5 ,IF(P74,5,0))))))

HTH,
Paul

--

"Aaron Hodson (Coversure)" wrote in message
...
I am trying to use the below formula in cell C7:

=IF(P7=0,1,IF(P7=0<1,2,IF(P7=1<2,3,IF(P7=2<3,4,IF( P7=3<4,5,IF(P7=4,5,0))))))

The idea is that if P7 equals 0, then C7 will show 1
If P7 is greater than 0 and less than 1, then C7 will show 2
If P7 is equal to 1 but less than 2, then C7 will show 3
If P7 is equal to 2 but less than 3, then C7 will show 4
If P7 is equal to 3 but less than 4, then C7 will show 5
If P7 is greater than 4, then C7 will show 6

At present only '0' works in p7 showing '1' in C7

Thanks in anticipation,

I am sure I will kick myself when I see the answer!

Thanks

Aaron