+ Reply to Thread
Results 1 to 7 of 7

If statement

Hybrid View

  1. #1
    Registered User
    Join Date
    06-18-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Post If statement

    Hello,

    I am having some difficulty trying to code some if statements under a particular cell in excel 2007. Attatched is the text file with the pseudocode and explanation of what i wanted to program in order to meet certain rules.I have also attached a template of the form that I have been trying to modify with this code.

    Thanks
    Attached Files Attached Files
    Last edited by vargs; 06-29-2010 at 12:27 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: If statement help

    Hi

    May pay to have another look at the items in the text file. The test for "missing" is repeated. Also, are these in priority order? If so, then the test for A2="gv" will mean that the last 2 conditions don't get evaluated. If the are not in priority order, then rearrange to establish the priority.

    rylo

  3. #3
    Registered User
    Join Date
    06-18-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: If statement help

    Hello,

    I took another look at my pseudocode txt file and have revised it.
    Attatched is the revised version and I have reestablished the priority of statements.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: If statement help

    Hi

    Second last criteria is:
    If (A2="gv" & a2<>"gv")

    Doesn't make sense to me. It either is, or it is not, but it can't be both.

    rylo

  5. #5
    Registered User
    Join Date
    06-18-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: If statement help

    Ah I hope this can clear up the confusion,
    the second to last criteria
    If (A2="gv" & a2<>"gv")
    If b2,c2,d2,e2,g2=" "
    says that regardless if A2 is equal to "gv" or not, if one of the following cells are blank: b2,c2,d2,e2,g2, then the final output cell H2 will say "pending"
    The first part of this statement may not even be necessary. The if statement could very well just be
    If b2,c2,d2,e2,g2=" "
    H2="Pending"


    thanks
    Last edited by vargs; 06-28-2010 at 08:22 AM.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: If statement

    Hi

    Try this
    =IF(OR(B2="Missing",B2="Maintain"),B2,
    IF(AND(A2="gv", B2="return",COUNTIF(C2:G2,"Save")>0),"save",
    IF(AND(B2="return",COUNTIF(D2:E2,"save")+COUNTIF(G2,"save")>0),"save",
    IF(AND(A2<>"gv",COUNTIF(B2:E2,"destroy")+COUNTIF(G2,"destroy")=5),"destroy",
    IF(AND( COUNTIF(B2:E2,"")+COUNTIF(G2,"") > 0),"Pending",
    IF(A2="gv",F2,"something not considered"
    ))))))
    rylo

  7. #7
    Registered User
    Join Date
    06-18-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: If statement

    Thank you so much for your help and pacience with me.
    It works as intended, I greatly appreciate everything that you have done!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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