ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF AND question (https://www.excelbanter.com/excel-worksheet-functions/28369-if-question.html)

Lee

IF AND question
 
How would I write a function with the following conditions

If H1 < 1.7 and K2 <=1 return 1
If H1 < 1.7 and K2 is between 1 and 2 return 2 (if k2 = 2 return 2)
If H1 < 1.7 and K2 is between 2 and 3 return 3 (if k2 = 2 return 3)
If H1 < 1.7 and K2 3 return 3
If H1 = 1.7 return 1.7


Ragdyer

Your second and third line cannot work.

See if this fits your scenario:

=IF(H1=1.7,1.7,IF(K2<=1,1,IF(K2<=2,2,3)))
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Lee" wrote in message
...
How would I write a function with the following conditions

If H1 < 1.7 and K2 <=1 return 1
If H1 < 1.7 and K2 is between 1 and 2 return 2 (if k2 = 2 return 2)
If H1 < 1.7 and K2 is between 2 and 3 return 3 (if k2 = 2 return 3)
If H1 < 1.7 and K2 3 return 3
If H1 = 1.7 return 1.7



Ron Rosenfeld

On Sun, 29 May 2005 14:29:51 -0700, Lee wrote:

How would I write a function with the following conditions

If H1 < 1.7 and K2 <=1 return 1
If H1 < 1.7 and K2 is between 1 and 2 return 2 (if k2 = 2 return 2)
If H1 < 1.7 and K2 is between 2 and 3 return 3 (if k2 = 2 return 3)
If H1 < 1.7 and K2 3 return 3
If H1 = 1.7 return 1.7



=IF(H1<1.7,MAX(1,MIN(3,CEILING(K2,1))),1.7)


--ron


All times are GMT +1. The time now is 01:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com