+ Reply to Thread
Results 1 to 3 of 3

Combining MID, LEN, and ABS, all within an IF statement

Hybrid View

rfernandes Combining MID, LEN, and ABS,... 08-23-2012, 08:28 AM
daddylonglegs Re: Combining MID, LEN, and... 08-23-2012, 08:35 AM
rfernandes Re: Combining MID, LEN, and... 08-23-2012, 08:58 AM
  1. #1
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695

    Re: Combining MID, LEN, and ABS, all within an IF statement

    =MID(D8,LEN(D8)-2,2) gives you the first 2 of the last 3 characters of D2 so instead of using

    MID(D8,LEN(D8)-2,2)="SR"

    try using COUNTIF instead, i.e.

    COUNTIF(D2,"*SR?")=1

    That will give you TRUE/FALSE depending on whether "SR" occurs in that position or not.....without any errors
    Audere est facere

  2. #2
    Registered User
    Join Date
    07-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Combining MID, LEN, and ABS, all within an IF statement

    I've realized I am a complete idiot.. I can use both options (yours and mine). The key is that I should have been applying it to all of those strings (there are three MID functions that include that "SR" requirement).


    Thanks daddylonglegs!

+ 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