+ Reply to Thread
Results 1 to 6 of 6

if statement help please. Wrong value being returned.

  1. #1
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    if statement help please. Wrong value being returned.

    if statement fix.xlsx

    Hi all.

    I hope someone can help.

    I am trying to return a value open or closed in a cell depending on if a item is completed or not. The problem is I always return open because the cell that holds "Completed" I am looking at has a date in it as well.

    Example (the first one should say closed because both are completed). 1st line has attachment
    Last edited by Mechjo16; 05-26-2013 at 09:58 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: if statement help please. Wrong value being returned.

    Hi and welcome to the forum

    Try something like this - assuming your data is in A1...

    =if(A1="*"&"Completed"&*"*,"Completed","Open")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: if statement help please. Wrong value being returned.

    Quote Originally Posted by FDibbins View Post
    Hi and welcome to the forum

    Try something like this - assuming your data is in A1...

    =if(A1="*"&"Completed"&*"*,"Completed","Open")

    Thanks for the reply. I kept getting an error when I input that formula. I updated my post and attached a example of my problem in line one.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: if statement help please. Wrong value being returned.

    Maybe this...

    Entered in C3 and copied down:

    =IF(COUNTIF(E3:H3,"*Completed*")=4,"Completed","Open")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: if statement help please. Wrong value being returned.

    Quote Originally Posted by Tony Valko View Post
    Maybe this...

    Entered in C3 and copied down:

    =IF(COUNTIF(E3:H3,"*Completed*")=4,"Completed","Open")
    Great! That will do it. thanks!! I tried that once but didn't know I had to do the " =4" part.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: if statement help please. Wrong value being returned.

    You're welcome. Thanks for the feedback!

+ 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