Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
Hi I am having a logical problem with If statement....
this is my formula: =IF(K9=$K$20&$K$20=1, 1, 0) is there another way of doing this or what is the problem, right now, the formula always gives 0, even when K9 and K20 = 1..... I don't know if there is something simple that I am overlooking?? what i want to do is output a 1 when K9 and K20 both equal 1, but not when they both equal 0. thanks!! |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
Something like this:
=IF(AND(K9=1,K20=1),1,0) or even: =K9*K20 if both cells can only be 1 or 0. Hope this helps. Pete On Feb 4, 5:19*pm, kknob wrote: Hi I am having a logical problem with If statement.... this is my formula: =IF(K9=$K$20&$K$20=1, 1, 0) is there another way of doing this or what is the problem, right now, the formula always gives 0, even when K9 and K20 = 1..... *I don't know if there is something simple that I am overlooking?? what i want to do is output a 1 when K9 and K20 both equal 1, but not when they both equal 0. thanks!! |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
=if(and(k9=1,$k$20=1),1,0)
or =--(and(k9=1,$k$20=1)) The and() returns true or false. The -- stuff changes the True to 1 and false to 0. kknob wrote: Hi I am having a logical problem with If statement.... this is my formula: =IF(K9=$K$20&$K$20=1, 1, 0) is there another way of doing this or what is the problem, right now, the formula always gives 0, even when K9 and K20 = 1..... I don't know if there is something simple that I am overlooking?? what i want to do is output a 1 when K9 and K20 both equal 1, but not when they both equal 0. thanks!! -- Dave Peterson |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
If the only options are 1 and 0 for both K9 and K20, use:
=K9 * K20 this formula returns 1 when both the cells are 1, otherwise 0. -- Gary''s Student - gsnu2007d |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
Hi,
Take =IF(AND(K9=$K$20,$K$20=1), 1, 0) or shorter in this special case - if inputs can only be 1 or 0 =--AND(K9,K20) BTW: The first formula will return 1 only if both K9 and K20 are 1. If one or both are not equal to 1 it will return 0. The second formula will return 1 if both inputs are not equal to zero. This irrelevant if inputs can only be 1 or 0 but think of empty cells or values like3, 4, or 0.0001. Regards, Bernd |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
=IF(AND(K9=$K$20,$K$20=1),1, 0) =IF(AND(K9=1,$K$20=1),1, 0) =IF(K9+$K$20=2,1,0) HTH, Paul -- "kknob" wrote in message ... Hi I am having a logical problem with If statement.... this is my formula: =IF(K9=$K$20&$K$20=1, 1, 0) is there another way of doing this or what is the problem, right now, the formula always gives 0, even when K9 and K20 = 1..... I don't know if there is something simple that I am overlooking?? what i want to do is output a 1 when K9 and K20 both equal 1, but not when they both equal 0. thanks!! |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
Thanks everyone! I'm using the =K9*K20 formula, that works best since
it can only be 1 or 0. Thanks Pete! So simple it passed right by me :) |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Simple Logical problem
You're welcome - looks like it passed right by the others, too !! <bg
Pete On Feb 4, 5:45*pm, kknob wrote: Thanks everyone! *I'm using the =K9*K20 formula, that works best since it can only be 1 or 0. *Thanks Pete! *So simple it passed right by me :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple problem? | Excel Worksheet Functions | |||
Logical formula problem | Excel Worksheet Functions | |||
Problem with nested logical formula. | Excel Worksheet Functions | |||
Logical problem | Excel Discussion (Misc queries) |