locked
Search for last 4 - 5 character RRS feed

  • Question

  • Hi,

    I need to search for to last 4 -5 characters in Itemid. It lo0ks like axv-2345-rt-DN40, axv-2345-rt-TS300 or axv-2345-rt-DN100. I need to get those items that end with 'DN???'. I have tried with FIND() and SEARCH().


    Larra
    Wednesday, August 24, 2011 2:26 AM

Answers

  • Larra,

    SEARCH returns an error if the search text is not found. Thus, you should surround SEARCH with an IF that always return a correct value.

    Once you have found the position of the desired pattern, to check if it is in the last 4/5 characters, you just compare it with the length of the code.

    Your formula might look like this:

    =IF (ISERROR (SEARCH("DN", Table1[Code])), 0, SEARCH("DN", Table[Code])) >= LEN (Table1[Code]) - 5


    Alberto Ferrari
    http://www.powerpivotworkshop.com
    • Marked as answer by Larra Wednesday, August 24, 2011 11:19 AM
    Wednesday, August 24, 2011 8:46 AM