+ Reply to Thread
Results 1 to 4 of 4

if statement referencing a nested if(mid) statement

  1. #1
    Registered User
    Join Date
    04-14-2016
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    2

    if statement referencing a nested if(mid) statement

    I am using an if statement that references an nested if/mid statement on another sheet and it is returning all false when one is true.

    Cell data
    Strike Last Net Bid Ask Vol Int Strike
    FXY1615D65-E* 0 0 23.3 24.1 0 0 65

    FXY1615D72.5-E* 0 0 15.9 16.3 0 0 72.5

    FXY1615D105-E* 0 0 0 0.15 0 0 105



    =IF(MID(C11,11,1)=".",MID(C11,9,4),IF((MID(C11,12,1)="-"),MID(C11,9,3),MID(C11,9,2)))

    The above nested function first references first "strike" and then returns the numbers to second "strike." The function works properly. However, when I do an if inequality referencing on another sheet, one of the outputs, such as 105, it returns false even when it is true.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: if statement referencing a nested if(mid) statement

    MID is a Text function and produce a text string, that is, it will return text "105", not the number 105. Hence they are not equal.

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-14-2016
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    2

    Re: if statement referencing a nested if(mid) statement

    Brilliant! The text nature of Mid did not dawn on me. Worked like a charm.
    Last edited by kantjustice; 04-14-2016 at 06:09 PM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: if statement referencing a nested if(mid) statement

    You're welcome.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Nested IF Statement with OR Clause Only Processes First IF Statement
    By ExcelQuestFL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-09-2016, 04:30 PM
  2. Replies: 2
    Last Post: 07-09-2015, 04:25 PM
  3. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  4. [SOLVED] Nested If Statement - ISBLANK and ISNA in same statement?
    By Janc in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-23-2013, 09:00 AM
  5. If statement Referencing another IF statement
    By Firemaster in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-10-2012, 09:28 AM
  6. [SOLVED] Nested IF Statement with AND Statement
    By surfeitinertia in forum Excel General
    Replies: 8
    Last Post: 09-05-2012, 05:52 AM
  7. Replies: 6
    Last Post: 01-14-2009, 06:59 PM

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