Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple problem? Foobi Excel Worksheet Functions 3 February 10th 06 10:24 PM
Logical formula problem irresistible007 Excel Worksheet Functions 1 November 17th 05 07:14 AM
Problem with nested logical formula. Bill R Excel Worksheet Functions 6 September 26th 05 04:36 AM
Logical problem kernelwiz Excel Discussion (Misc queries) 4 September 13th 05 10:35 PM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"