ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF Function not working (https://www.excelbanter.com/excel-discussion-misc-queries/11083-if-function-not-working.html)

sonicj

IF Function not working
 
The first and second IF functions are working, but not the third:
=IF(B1<B2,C1*.005,IF(B1=B2,C1*.01,IF(B1=B3,C1*.0 12)))
I assume it has something to do with the = but I don't know another way.
Thank you.

galimi

There is no indication on what action should be taken if B1<B3, the False
condition

http://HelpExcel.com

"sonicj" wrote:

The first and second IF functions are working, but not the third:
=IF(B1<B2,C1*.005,IF(B1=B2,C1*.01,IF(B1=B3,C1*.0 12)))
I assume it has something to do with the = but I don't know another way.
Thank you.


Bill Martin -- (Remove NOSPAM from address)

sonicj wrote:
The first and second IF functions are working, but not the third:
=IF(B1<B2,C1*.005,IF(B1=B2,C1*.01,IF(B1=B3,C1*.0 12)))
I assume it has something to do with the = but I don't know another way.
Thank you.


As I understand the logic of your expression it can never get to the
third branch (which seems to be what you're experiencing).

1) if B1 < B2, THEN Case1

2) If B1 = B2 THEN Case2

3) Can't ever get to Case3. ALL cases will be trapped by 1 or 2.

If you understand K Maps for logic design, apply one to your equations
and it will leap right off the paper at you.


Perhaps you intended:

= IF(B1<B2,C1*.005,IF(B1=B3,C1*.012,C1*.01))

Good luck...

Bill


All times are GMT +1. The time now is 12:19 PM.

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