ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Does True Have a Numerical Value (https://www.excelbanter.com/excel-worksheet-functions/62542-does-true-have-numerical-value.html)

Jacob_F_Roecker

Does True Have a Numerical Value
 
OK I know that I could convert "true" to a numerical value with my own
formula but let's say I'm using the COUNTIF() function and it comes back
TRUE. Does TRUE have a numerical value?

I know that when I use the DELTA() funciton and two things equal it returns
a "1"

I'm not making a spreadsheet now that actually applies this. Just working
on something in my head for further knowledge.

What I'm hoping is that TRUE=1 and 0=FALSE. But I'm probably not so lucky.
They're probably NOT interchangable for a reason and I'd just like to know
why.



Peo Sjoblom

Does True Have a Numerical Value
 
If you calculate with TRUE or FALSE they return 1 and 0
That is the whole idea behind array formulas, however the only way
countif can return TRUE is if you use a condition like

=COUNTIF(A2:A10,"x")0

and if you for instance have 10 TRUE in C1:C10

=SUM(C1:C10)

will return 0 however if you add -- into the mixture like in

=SUM(--C1:C10)

and enter it with ctrl + shift & enter it will return 10



--
Regards,

Peo Sjoblom

(No private emails please)


"Jacob_F_Roecker" wrote in message
...
OK I know that I could convert "true" to a numerical value with my own
formula but let's say I'm using the COUNTIF() function and it comes back
TRUE. Does TRUE have a numerical value?

I know that when I use the DELTA() funciton and two things equal it
returns
a "1"

I'm not making a spreadsheet now that actually applies this. Just working
on something in my head for further knowledge.

What I'm hoping is that TRUE=1 and 0=FALSE. But I'm probably not so
lucky.
They're probably NOT interchangable for a reason and I'd just like to know
why.




Roger Govier

Does True Have a Numerical Value
 
Hi Jacob

In addition to the advice given by Peo, you can convert your original True's
to 1's and False's to 0's by using the double unary operator --.

= --TRUE will return a 1
=--(COUNTIF(A2:A10,"x")0) will also return a 1 rather than TRUE,
hence you can sum the True's (1's) without having to resort to an array
formula.
--
Regards

Roger Govier


"Jacob_F_Roecker" wrote in message
...
OK I know that I could convert "true" to a numerical value with my own
formula but let's say I'm using the COUNTIF() function and it comes back
TRUE. Does TRUE have a numerical value?

I know that when I use the DELTA() funciton and two things equal it
returns
a "1"

I'm not making a spreadsheet now that actually applies this. Just working
on something in my head for further knowledge.

What I'm hoping is that TRUE=1 and 0=FALSE. But I'm probably not so
lucky.
They're probably NOT interchangable for a reason and I'd just like to know
why.






All times are GMT +1. The time now is 08:15 PM.

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