+ Reply to Thread
Results 1 to 5 of 5

issue with if clauses

Hybrid View

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    3

    issue with if clauses

    I have the following data:

    A B C D
    1/14/2013 1/1/2002 barg
    1/14/2013 6/1/2012 nonbarg

    and need to put a result into D as a result of the following factors:
    If B is less A-5yrs and 'barg' is in C, then NA, otherwise Review and if C has 'nonbarg' always enter NA

    I used * =IF(C5="barg",(IF(A5-(365*5)<B5,"NA", "Review"))) - and this works

    However when I add the another clause I get the #VALUE error:
    =IF(C6="nonbarg","NA","Done")+(IF(C6="barg",IF(A6-(365*5)<B6,"NA","Done")))

    What an I doing wrong? Can someone help put me out of my misery? Many thanks for your attention.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: issue with if clauses

    What's the logic of the clause you are adding?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-07-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: issue with if clauses

    Thank you for the response:

    If 'nonbarg' is in column C, then the answer is always NA.
    If 'barg' is in the column C, and the number of years is less than 5, the answer is NA
    If 'barg' is in the column C, and the number of years is greater than 5, the answer is Done (Review) - user keeps changing her mind.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: issue with if clauses

    Perhaps this.

    Formula: copy to clipboard
    =IF(C5="nonbarg","NA",IF(C5="barg",IF(DATEDIF(B5,A5,"y")<5,"NA","Done (Review) - user keeps changing her mind")))

  5. #5
    Registered User
    Join Date
    01-07-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: issue with if clauses

    Many thanks, this works beautifully and is so much more elegant. I didn't know about the DATEDIF - so thank you also for that.

+ 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