Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
KRK KRK is offline
external usenet poster
 
Posts: 91
Default True/False, On/Off

Hello,

I have a cell (say A1) which contains a value 0 or 1 , or equivalently
FALSE or TRUE. I use it in an IF function elsewhere,, eg.
IF(A1,'Cat','Dog').

No problem so far.

I would prefer to display 'OFF' or 'ON' in A1. Can I make OFF & ON
equivalent to boolean values, or must I change the formula to IF(a1='ON',
'Cat','Dog') ?

Thanks
K

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 563
Default True/False, On/Off

The second option is needed IF(A1="ON", "Cat", "Dog")
Note the double quotes (I expect you meant to use them!)
There is no way to alter FALSE to OFF, TRUE to ON
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"KRK" wrote in message
...
Hello,

I have a cell (say A1) which contains a value 0 or 1 , or equivalently
FALSE or TRUE. I use it in an IF function elsewhere,, eg.
IF(A1,'Cat','Dog').

No problem so far.

I would prefer to display 'OFF' or 'ON' in A1. Can I make OFF & ON
equivalent to boolean values, or must I change the formula to IF(a1='ON',
'Cat','Dog') ?

Thanks
K


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 905
Default True/False, On/Off

"KRK" wrote:
I have a cell (say A1) which contains a value 0 or 1 ,
or equivalently FALSE or TRUE.

[....]
I would prefer to display 'OFF' or 'ON' in A1.


If the cell value is 0 or 1, not FALSE or TRUE, you can use the following
Custom format to display "off" or "on":

[=0]"off";[=1]"on"

I have not found a custom format that works when the cell value is FALSE or
TRUE per se.


----- original message -----

"KRK" wrote in message
...
Hello,

I have a cell (say A1) which contains a value 0 or 1 , or equivalently
FALSE or TRUE. I use it in an IF function elsewhere,, eg.
IF(A1,'Cat','Dog').

No problem so far.

I would prefer to display 'OFF' or 'ON' in A1. Can I make OFF & ON
equivalent to boolean values, or must I change the formula to IF(a1='ON',
'Cat','Dog') ?

Thanks
K


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 905
Default True/False, On/Off

PS....

I wrote:
I have not found a custom format that works when
the cell value is FALSE or TRUE per se.


But you might be able to ensure that the value in the cell (A1) is zero or
one instead of FALSE or TRUE. That depends on how that value is derived.
For example, if A1 has the formula =(B1=B2), you can change that to
=--(B1=B2). The "--" (or any other arithmetic operation) has the effect of
converting the boolean values to zero or one.


----- original message -----

"Joe User" <joeu2004 wrote in message
...
"KRK" wrote:
I have a cell (say A1) which contains a value 0 or 1 ,
or equivalently FALSE or TRUE.

[....]
I would prefer to display 'OFF' or 'ON' in A1.


If the cell value is 0 or 1, not FALSE or TRUE, you can use the following
Custom format to display "off" or "on":

[=0]"off";[=1]"on"

I have not found a custom format that works when the cell value is FALSE
or TRUE per se.


----- original message -----

"KRK" wrote in message
...
Hello,

I have a cell (say A1) which contains a value 0 or 1 , or equivalently
FALSE or TRUE. I use it in an IF function elsewhere,, eg.
IF(A1,'Cat','Dog').

No problem so far.

I would prefer to display 'OFF' or 'ON' in A1. Can I make OFF & ON
equivalent to boolean values, or must I change the formula to IF(a1='ON',
'Cat','Dog') ?

Thanks
K



  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,934
Default True/False, On/Off

If the cell value is 0 or 1, not FALSE or TRUE, you can use the following
Custom format to display "off" or "on":

[=0]"off";[=1]"on"


A slightly simpler format pattern that can be used to do this is...

"On";;"Off"

--
Rick (MVP - Excel)



  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 905
Default True/False, On/Off

"Rick Rothstein" wrote:
A slightly simpler format pattern that can be used
to do this is...
"On";;"Off"


Right. Klunk!

That's what I started with. But when it did not work with cell values of
TRUE and FALSE, I moved on to conditional custom formats, still trying with
TRUE and FALSE (e.g. [=TRUE]"on"). And when that did not work, I simply
tweaked the conditional custom format to use 1 and 0. Which still did not
work with cell values of TRUE and FALSE, of course; hence the requirement to
actually use 1 and 0. At that point, I shoulda started back Square One.
But I was stuck in a particular mindset. Klunk!

Thanks for posting the better custom format.


----- original message -----

"Rick Rothstein" wrote in message
...
If the cell value is 0 or 1, not FALSE or TRUE, you can use the following
Custom format to display "off" or "on":

[=0]"off";[=1]"on"


A slightly simpler format pattern that can be used to do this is...

"On";;"Off"

--
Rick (MVP - Excel)


  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,934
Default True/False, On/Off

A slightly simpler format pattern that can be used
to do this is...
"On";;"Off"


Right. Klunk!

That's what I started with. But when it did not work with cell values of
TRUE and FALSE, I moved on to conditional custom formats, still trying
with TRUE and FALSE (e.g. [=TRUE]"on"). And when that did not work, I
simply tweaked the conditional custom format to use 1 and 0. Which still
did not work with cell values of TRUE and FALSE, of course; hence the
requirement to actually use 1 and 0. At that point, I shoulda started
back Square One. But I was stuck in a particular mindset. Klunk!


We've all been there 'Joe'.... we have all been there. <g

--
Rick (MVP - Excel)

  #8   Report Post  
Posted to microsoft.public.excel.newusers
KRK KRK is offline
external usenet poster
 
Posts: 91
Default True/False, On/Off - Thanks for the help

Hi all, & thanks for the help, its very useful.

KK


"KRK" wrote in message
...
Hello,

I have a cell (say A1) which contains a value 0 or 1 , or equivalently
FALSE or TRUE. I use it in an IF function elsewhere,, eg.
IF(A1,'Cat','Dog').

No problem so far.

I would prefer to display 'OFF' or 'ON' in A1. Can I make OFF & ON
equivalent to boolean values, or must I change the formula to IF(a1='ON',
'Cat','Dog') ?

Thanks
K


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
=IF(test,true,false) only ever returns "true"? TagTech Excel Worksheet Functions 5 December 10th 08 03:04 PM
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu LunaMoon Excel Discussion (Misc queries) 9 July 29th 08 12:28 AM
Search for 2 true arguments and return true or false David Excel Discussion (Misc queries) 3 July 15th 06 10:18 AM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 10:28 AM
Reverse false and combine with true true value Emmie99 Excel Worksheet Functions 5 August 17th 05 04:38 PM


All times are GMT +1. The time now is 08:24 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"