How to sum {TRUE,FALSE,TRUE} to get 2 ?

eliW

Well-known Member
Joined
Mar 2, 2002
Messages
1,940
Hi,
It is a periodical blackout, please help.
Eli
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
On 2002-06-06 03:19, eliW wrote:
Hi,
It is a periodical blackout, please help.
Eli

how are receiving the TRUE,FALSE,TRUE?

as you've described:

=SUM(TRUE,FALSE,TRUE)

=2
 
Upvote 0
hi Eli
BOOK1
ABCD
11020TRUE
22010FALSE
31020TRUE
42
5
...


remember ctrl-shift-enter when entering array formulas
hth
 
Upvote 0
Ian,
In A1:A3 I have TRUE,FALSE,TRUE
When I put in A4 =SUM(A1:A3) I get 0
What's the catch?
Eli
 
Upvote 0

In A1:A3 I have TRUE,FALSE,TRUE
When I put in A4 =SUM(A1:A3) I get 0
What's the catch?


Eli,

Coercion is needed, therefore try:

=SUMPRODUCT((A1:A3)+0)

although I'd prefer:

=COUNTIF(A1:A3,TRUE)

Aladin
 
Upvote 0


=SUM(TRUE,FALSE,TRUE)

=2



Ian,

When this set of logical values are in a range, say, A1:A3,

=SUM(A1:A3)

fails. The Help file states:

SUM(number1,number2, ...)

Number1, number2, ... are 1 to 30 arguments for which you want the total value or sum.

[1] Numbers, logical values, and text representations of numbers that you type directly into the list of arguments are counted. See the first and second examples following.


[2] If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are ignored. See the third example following.

=SUM(TRUE,FALSE,TRUE) by [1] results in 2.

=SUM(A1:A3), where A1=TRUE,A2=FALSE, and A3=TRUE, by [2] results in 0.

Aladin
 
Upvote 0
On 2002-06-06 05:00, Aladin Akyurek wrote:


=SUM(TRUE,FALSE,TRUE)

=2



Ian,

When this set of logical values are in a range, say, A1:A3,

=SUM(A1:A3)

fails. The Help file states:

SUM(number1,number2, ...)

Number1, number2, ... are 1 to 30 arguments for which you want the total value or sum.

[1] Numbers, logical values, and text representations of numbers that you type directly into the list of arguments are counted. See the first and second examples following.


[2] If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are ignored. See the third example following.

=SUM(TRUE,FALSE,TRUE) by [1] results in 2.

=SUM(A1:A3), where A1=TRUE,A2=FALSE, and A3=TRUE, by [2] results in 0.

Aladin

Your quite right! BUT I thought I'd pose the question and was about submit:

=SUMPRODUCT((E7:E11)*1)

until I was called off elsewhere.
 
Upvote 0
On 2002-06-06 04:27, eliW wrote:
Ian,
In A1:A3 I have TRUE,FALSE,TRUE
When I put in A4 =SUM(A1:A3) I get 0
What's the catch?
Eli

Use any of...

{=SUM(A1:A3+0)}
=A1+A2+A3
=SUM(PRODUCT(A1:A3,1))

Note: The 1st formula is an array formula which must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula. For more on array formulas see the Excel Help topic for "About array formulas and how to enter them".
This message was edited by Mark W. on 2002-06-06 08:36
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top