View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
IF function incompetent[_2_] IF function incompetent[_2_] is offline
external usenet poster
 
Posts: 18
Default IF formula help - incorporate greater than & smaller than

I am trying to do a similar thing but my values are different.

The idea is that if J16 equals 0, then G11 will show 0
If J16 is greater than 0 and less than 1, then G11 will show 0
If J16 is equal to 1 but less than 2, then G11 will show 1.5
If J16 is equal to 2 but less than 3, then G11 will show 1.75
If J16 is equal to 3 but less than 4, then G11 will show 2
If J16 is equal to 4 but less than 5, then G11 will show 2.5


Can someone help me with this one?? :(

"PCLIVE" wrote:

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