+ Reply to Thread
Results 1 to 7 of 7

IF Statment

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    Ruthin, Wales
    MS-Off Ver
    Excel 2003, 2007, 2010 & 2013
    Posts
    7

    IF Statment

    Can some explain why

    =IF(J2="TRUE",2,4) returns a value of 4

    and

    =IF(J2="TRU",2,4) returns a value of 2

    Does excel do something odd with the word TRUE?

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Statment

    =IF(J2="TRU",2,4) returns a value of 2
    Returns 2 if you have word "TRU"

    For the words TRUE and FALSE, excel does not need " "

    So with TRUE in J2

    IF(J2=TRUE,2,4) returns a value of 2.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    Ruthin, Wales
    MS-Off Ver
    Excel 2003, 2007, 2010 & 2013
    Posts
    7

    Re: IF Statment

    Hi

    No this does not work either. Tried that....

    So with TRUE in J2

    IF(J2=TRUE,2,4) returns a value of 4 not 2.... no idea why?

    IF(J2=TRU,2,4) returns a value of 2. If you drop the E then yes you get the value 2.

    So I very much suspect they dont let you use the word TRUE as it is part of the logic.....

    Try it and let me know..
    Last edited by bigjohnuk; 11-13-2012 at 07:09 AM.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Statment

    What you say is not correct.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-11-2012
    Location
    Ruthin, Wales
    MS-Off Ver
    Excel 2003, 2007, 2010 & 2013
    Posts
    7

    Re: IF Statment

    If-pain-weight.xlsm

    Hi See attached.

    IF(J2=TRUE,2,4) returns a value of 4 not 2.... no idea why?

    John
    http://www.itheadcentre.com

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Statment

    Format J2 as general_not text and type TRUE again.

  7. #7
    Registered User
    Join Date
    10-11-2012
    Location
    Ruthin, Wales
    MS-Off Ver
    Excel 2003, 2007, 2010 & 2013
    Posts
    7

    Re: IF Statment

    Well that is mad.... So setting the field General and Text, even though the word is text.... it works. Which I think goes to show that Excel does treat the word TRUE as a command type of thing.

    John

+ 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