Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ASA ASA is offline
external usenet poster
 
Posts: 13
Default Making 'True' =1 "false" =0

Is there a setting that will automatically apply these at the moment I have
to apply an if statement before I can get any calculations done.

=SUMPRODUCT($C$4:$I$4=C4,$C$5:$I$50) gives a result of 0 even though it
shows
=SUMPRODUCT({TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FAL SE},{TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE})

whereas if I do =SUMPRODUCT(IF($C$4:$I$4=C4,1,0),IF($C$5:$I$50,1, 0)) gives
the results of 1 with the array of
=SUMPRODUCT({1,0,0,0,0,1,0},{1,1,1,1,1,0,1})

It seems to treat the trues and falses as text rather than values.

I do not want to have to put the if statement in.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Making 'True' =1 "false" =0

Try it like this:

=SUMPRODUCT(--($C$4:$I$4=C4),--($C$5:$I$50))

--
Biff
Microsoft Excel MVP


"ASA" wrote in message
...
Is there a setting that will automatically apply these at the moment I
have
to apply an if statement before I can get any calculations done.

=SUMPRODUCT($C$4:$I$4=C4,$C$5:$I$50) gives a result of 0 even though it
shows
=SUMPRODUCT({TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FAL SE},{TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE})

whereas if I do =SUMPRODUCT(IF($C$4:$I$4=C4,1,0),IF($C$5:$I$50,1, 0))
gives
the results of 1 with the array of
=SUMPRODUCT({1,0,0,0,0,1,0},{1,1,1,1,1,0,1})

It seems to treat the trues and falses as text rather than values.

I do not want to have to put the if statement in.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Making 'True' =1 "false" =0

On Sun, 11 Nov 2007 20:38:01 -0800, ASA wrote:

Is there a setting that will automatically apply these at the moment I have
to apply an if statement before I can get any calculations done.

=SUMPRODUCT($C$4:$I$4=C4,$C$5:$I$50) gives a result of 0 even though it
shows
=SUMPRODUCT({TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FA LSE},{TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE})

whereas if I do =SUMPRODUCT(IF($C$4:$I$4=C4,1,0),IF($C$5:$I$50,1, 0)) gives
the results of 1 with the array of
=SUMPRODUCT({1,0,0,0,0,1,0},{1,1,1,1,1,0,1})

It seems to treat the trues and falses as text rather than values.

I do not want to have to put the if statement in.



=SUMPRODUCT(($C$4:$I$4=C4)*($C$5:$I$50))

or

=SUMPRODUCT(--($C$4:$I$4=C4),--($C$5:$I$50))
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ASA ASA is offline
external usenet poster
 
Posts: 13
Default Making 'True' =1 "false" =0

Thank you , I assume that the first - somehow multiplies by - 1 and the
second one reverses it to make it positive again.



"T. Valko" wrote:

Try it like this:

=SUMPRODUCT(--($C$4:$I$4=C4),--($C$5:$I$50))

--
Biff
Microsoft Excel MVP


"ASA" wrote in message
...
Is there a setting that will automatically apply these at the moment I
have
to apply an if statement before I can get any calculations done.

=SUMPRODUCT($C$4:$I$4=C4,$C$5:$I$50) gives a result of 0 even though it
shows
=SUMPRODUCT({TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FAL SE},{TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE})

whereas if I do =SUMPRODUCT(IF($C$4:$I$4=C4,1,0),IF($C$5:$I$50,1, 0))
gives
the results of 1 with the array of
=SUMPRODUCT({1,0,0,0,0,1,0},{1,1,1,1,1,0,1})

It seems to treat the trues and falses as text rather than values.

I do not want to have to put the if statement in.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Making 'True' =1 "false" =0

I assume that the first - somehow multiplies by - 1

I don't know how Excel does this internally but it "coerces" the booleans
first to negative numbers and then to positive numbers. Does it multiply
by - 1, that I don't know.

--
Biff
Microsoft Excel MVP


"ASA" wrote in message
...
Thank you , I assume that the first - somehow multiplies by - 1 and the
second one reverses it to make it positive again.



"T. Valko" wrote:

Try it like this:

=SUMPRODUCT(--($C$4:$I$4=C4),--($C$5:$I$50))

--
Biff
Microsoft Excel MVP


"ASA" wrote in message
...
Is there a setting that will automatically apply these at the moment I
have
to apply an if statement before I can get any calculations done.

=SUMPRODUCT($C$4:$I$4=C4,$C$5:$I$50) gives a result of 0 even though
it
shows
=SUMPRODUCT({TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FAL SE},{TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE})

whereas if I do =SUMPRODUCT(IF($C$4:$I$4=C4,1,0),IF($C$5:$I$50,1, 0))
gives
the results of 1 with the array of
=SUMPRODUCT({1,0,0,0,0,1,0},{1,1,1,1,1,0,1})

It seems to treat the trues and falses as text rather than values.

I do not want to have to put the if statement in.








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Making 'True' =1 "false" =0

Yes.
--
David Biddulph

"ASA" wrote in message
...
Thank you , I assume that the first - somehow multiplies by - 1 and the
second one reverses it to make it positive again.


"T. Valko" wrote:

Try it like this:

=SUMPRODUCT(--($C$4:$I$4=C4),--($C$5:$I$50))


"ASA" wrote in message
...
Is there a setting that will automatically apply these at the moment I
have
to apply an if statement before I can get any calculations done.

=SUMPRODUCT($C$4:$I$4=C4,$C$5:$I$50) gives a result of 0 even though
it
shows
=SUMPRODUCT({TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FAL SE},{TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE})

whereas if I do =SUMPRODUCT(IF($C$4:$I$4=C4,1,0),IF($C$5:$I$50,1, 0))
gives
the results of 1 with the array of
=SUMPRODUCT({1,0,0,0,0,1,0},{1,1,1,1,1,0,1})

It seems to treat the trues and falses as text rather than values.

I do not want to have to put the if statement in.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Making 'True' =1 "false" =0

Unlikely that it multiplies by -1, but it does negate the value, which has
the same effect, and the second negates again, a negative-negative is a
positive.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ASA" wrote in message
...
Thank you , I assume that the first - somehow multiplies by - 1 and the
second one reverses it to make it positive again.



"T. Valko" wrote:

Try it like this:

=SUMPRODUCT(--($C$4:$I$4=C4),--($C$5:$I$50))

--
Biff
Microsoft Excel MVP


"ASA" wrote in message
...
Is there a setting that will automatically apply these at the moment I
have
to apply an if statement before I can get any calculations done.

=SUMPRODUCT($C$4:$I$4=C4,$C$5:$I$50) gives a result of 0 even though
it
shows
=SUMPRODUCT({TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FAL SE},{TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE})

whereas if I do =SUMPRODUCT(IF($C$4:$I$4=C4,1,0),IF($C$5:$I$50,1, 0))
gives
the results of 1 with the array of
=SUMPRODUCT({1,0,0,0,0,1,0},{1,1,1,1,1,0,1})

It seems to treat the trues and falses as text rather than values.

I do not want to have to put the if statement in.






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
Check if cells contain the word "Thailand", return "TRUE" ali Excel Worksheet Functions 7 September 14th 07 09:53 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Typing "true" excel 2007 change it to "TRUE" Mr. T Excel Discussion (Misc queries) 2 April 11th 07 01:24 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Can you replace "TRUE" with " " in an exact formula? Sweetetc Excel Worksheet Functions 2 February 10th 06 01:11 PM


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

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

About Us

"It's about Microsoft Excel"