+ Reply to Thread
Results 1 to 5 of 5

IF statement help-IF AX21 is not equal to 40

  1. #1
    Registered User
    Join Date
    04-22-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    94

    IF statement help-IF AX21 is not equal to 40

    I am having difficulty with an If statement, it reads:

    =IF(AX21<>40, AP24)

    I want to add into this IF statement into it

    If(AX21=40, AS16)


    The statement will read IF AX21 is not equal to 40 display the value in AP24, or IF AX21 =40 display the value in AS16.

    I have tried the following but im getting an error:

    =IF(AND(AX21<>40,AX21=40,AP24,AS16))

    Can anyone help?
    Last edited by PRodgers4284; 10-02-2009 at 10:38 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    re: IF statement help-IF AX21 is not equal to 40

    =if(ax21<>40,ap24,as16)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    07-28-2009
    Location
    Orange County, CA
    MS-Off Ver
    Excel 2007
    Posts
    115

    re: IF statement help-IF AX21 is not equal to 40

    =if(ax21=40,as16,if(ax21<>40, ap24,""))

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    re: IF statement help-IF AX21 is not equal to 40

    garretonufer,

    Note: an IF will exit upon first TRUE being returned, it will not continue to process all subsequent arguments, eg

    =IF(1=1,1,IF(1<>1,2,""))

    The 2nd IF is never evaluated as the IF will exit on the first test returning true.

    On that basis as outlined already by Special-K there is no need for the embedded if given:

    =IF(value=40

    the answer can only be TRUE/FALSE therefore

    =IF(value=40,"yes","no")

    There is no need for

    =IF(value=40,"yes",IF(value<>40,"no",""))

    the fact that the formula is evaluating beyond the first IF means the value must not be 40 if it were the formula would have already exited.
    Last edited by DonkeyOte; 10-02-2009 at 02:42 PM. Reason: inconsistent example

  5. #5
    Forum Contributor
    Join Date
    07-28-2009
    Location
    Orange County, CA
    MS-Off Ver
    Excel 2007
    Posts
    115

    re: IF statement help-IF AX21 is not equal to 40

    I'm aware, but perhis argument it can never =40 AND <>40 it's one or the other, that beign said, it tests to see if the value is 40 if that's true, then it shows the value of a particular cell, if it's false then it checks if the value is not = to 40 therefore doing another action. however in corrolation with what you said
    Please Login or Register  to view this content.
    i don't know why i was over thinking it, i guess i was just looking at what was posted prior. oops!

+ 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