+ Reply to Thread
Results 1 to 4 of 4

How to use IF and MID together

  1. #1
    Registered User
    Join Date
    09-09-2011
    Location
    Madrid
    MS-Off Ver
    Excel 2007
    Posts
    1

    How to use IF and MID together

    Hi,
    I have some trouble to link the IF with the MID function.
    I have a cell with the follwing value: 1+0+2 and I want to show in another cell if the first character is not 0, display OK, otherwise if it is 0 display NO
    I have used the IF+MID functions, but it seems it doesnt work:
    =IF(MID(H2;1;1)<>0;"OK";"NO")
    It keeps showing NO, even if you put 0 as first char

    Could you please help me?
    Thanks

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: How to use IF and MID together

    Try

    =IF(LEFT(h2,1)<>"0";"OK";"NO")

  3. #3
    Registered User
    Join Date
    09-05-2011
    Location
    pune, india
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    5

    Re: How to use IF and MID together

    Quote Originally Posted by primitivefuture View Post
    Hi,
    I have some trouble to link the IF with the MID function.
    I have a cell with the follwing value: 1+0+2 and I want to show in another cell if the first character is not 0, display OK, otherwise if it is 0 display NO
    I have used the IF+MID functions, but it seems it doesnt work:
    =IF(MID(H2;1;1)<>0;"OK";"NO")
    It keeps showing NO, even if you put 0 as first char

    Could you please help me?
    Thanks
    Try this out!

    =IF(MID(H2,1,1)="0","OK","NO")

    Regards
    Swapnil.Next

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: How to use IF and MID together

    Next

    Do not quote entire posts unnecessarily

+ 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