+ Reply to Thread
Results 1 to 4 of 4

using an if statement with find to compute criteria

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    using an if statement with find to compute criteria

    I am working on a rather large spreadsheet and I am trying to do this:

    =IF(LEFT(H2,FIND(" ",H2))>E2,N,Y)

    However, when I enter that in, Excel gives me a VALUE error and I don't understand why.

    I even tried just putting in =LEFT(H2,FIND(" ",H2))>E2, to see what it would give me and it gave me all TRUE values, even after visual inspection some values are in fact supposed to be false.

    Basically, is there a way for Excel to combine the IF and the FIND functions to look at a value in a cell composed of a number and text and extract the number. Then once the number is extracted, compare that to a value in another cell and give me "Y" or "N" if the criteria is met or not?

    Thanks.

    Btw, I love this forum.
    Last edited by HP RodNuclear; 11-11-2010 at 03:55 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: using an if statement with find to compute criteria

    add a 0
    LEFT(H2,FIND(" ",H2))+0>E2 left returns text so add 0 to make it a real number to compare with e2
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Re: using an if statement with find to compute criteria

    This worked without the IF statement. However, when I add the if statement, it continue to gives me the VALUE error.

  4. #4
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: using an if statement with find to compute criteria

    You need to put quotes around your "N" and "Y":

    Please Login or Register  to view this content.
    Cheers,
    Last edited by ConneXionLost; 11-11-2010 at 03:28 PM.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ 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