+ Reply to Thread
Results 1 to 6 of 6

Replace TRUE with "1" and FALSE with "0"

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    Replace TRUE with "1" and FALSE with "0"

    When making a logical test in a cell the result is shown as the full 4-5 letter words 'TRUE' and 'FALSE' and that takes up a lot of unnecessary space.
    Is it possible make the logical tests show results as '1' and '0'?

    NSV

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Replace TRUE with "1" and FALSE with "0"

    Try something like

    =--(condition)

    such as

    =--(OR(A1="xyz",B1<>"blue"))

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Replace TRUE with "1" and FALSE with "0"

    yes add 0 to result or use --
    =--(a1=10)
    =(a1=10)+0
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Replace TRUE with "1" and FALSE with "0"

    use the double-hypen --

    for example: =--(B2>E2)
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Replace TRUE with "1" and FALSE with "0"

    ... or multiply a condition with 1

    =(condition)*1 will result in 1 if "condition" returns TRUE, and 0 if FALSE.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  6. #6
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    Re: Replace TRUE with "1" and FALSE with "0"

    Thank you - I did not realize that the TRUE/FALSE result could be treated like a number.

    NSV

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1