ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Combining Nested IF statement with Between operator (https://www.excelbanter.com/excel-worksheet-functions/60260-combining-nested-if-statement-between-operator.html)

Daisy

Combining Nested IF statement with Between operator
 
I'm trying to create a nested IF function that evaluates 3 conditions
and returns 1 of 3 possible "true" answers. I think I've gotten close
but I'm probably missing a comma or parentheses somewhere.

Here's the scenario:
Excel 2000, Windows XP
Column A contains employee names
Column B contains hours accrued
Column C contains a formula that evaluates three different conditions
based on the value in Column B

The example below assumes the formula is in cell C10:
If B10=20 or <=40, then multiply B10*4 and divide by 80
If B10<20 then the answer is 0
If B1040 then the answer is 2

Here's the formula I created first:

=IF(B10=20,B10*4/80,IF(B1040,2,IF(B10<20,0)))

What I'm missing is the between part (i.e. the first part should read
if B10=20 and <=40). I tried to insert the AND operator in the
following formula, but it doesn't work:

=IF(AND(B10=20,B10<=40),B10*4/80,IF(B1040,2,IF(B10<20,0)))

Any help would be greatly appreciated.


Niek Otten

Combining Nested IF statement with Between operator
 
=IF(AND(B10=20,B10<=40),B10*4/80,IF(B1040,2,0))

--
Kind regards,

Niek Otten

"Daisy" wrote in message
ups.com...
I'm trying to create a nested IF function that evaluates 3 conditions
and returns 1 of 3 possible "true" answers. I think I've gotten close
but I'm probably missing a comma or parentheses somewhere.

Here's the scenario:
Excel 2000, Windows XP
Column A contains employee names
Column B contains hours accrued
Column C contains a formula that evaluates three different conditions
based on the value in Column B

The example below assumes the formula is in cell C10:
If B10=20 or <=40, then multiply B10*4 and divide by 80
If B10<20 then the answer is 0
If B1040 then the answer is 2

Here's the formula I created first:

=IF(B10=20,B10*4/80,IF(B1040,2,IF(B10<20,0)))

What I'm missing is the between part (i.e. the first part should read
if B10=20 and <=40). I tried to insert the AND operator in the
following formula, but it doesn't work:

=IF(AND(B10=20,B10<=40),B10*4/80,IF(B1040,2,IF(B10<20,0)))

Any help would be greatly appreciated.




Daisy

Combining Nested IF statement with Between operator
 
Wow, that was fast! I tried it and it worked. Many thanks and have a
happy holiday!


gid951

Thanks - really helped me out of a tight spot today and fast. Many thanks


All times are GMT +1. The time now is 06:59 PM.

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