View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Formatting TRUE/FALSE to 1/0

On Mon, 19 Feb 2007 04:18:16 -0800, Smallweed
wrote:

It's nice to use TRUEs and FALSEs in simple calculations (such as add and
multiply) where TRUE cells are treated by Excel as having a value of 1 and
FALSE cells 0 - although it is strange that =SUM treats them all as 0.

Does anyone know a way of formatting logical cells to actually display 1 for
TRUE and 0 for FALSE?

Obviously one could put together a macro or UDF that physically converted
these values but I would ideally like some kind of Excel format.


The number formats only apply to cells that contain numbers.

If you want to display 1 or 0, you would have to convert the logical results to
numbers, perhaps by preceding your formula with a double unary.

e.g. =--(your_formula_that_returns_TRUE/FALSE)


--ron