• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Nesting

Weldon Riker

New Member
Excel Gurus

To the formula below, I need to add another "FIND". . .I need the formula to find "RC" as well. . .


=MID(G2,IFERROR(IFERROR(FIND("LI",G2),FIND("DP",G2)),LEN(G2)-6),7)
 
Could change to this setup:
=MID(G2,IFERROR(MIN(FIND({"LI","DP","RC"},G2)),LEN(G2)-6),7)

Now you can easily add more strings to search for if needed.
 
That looked elegant! but the LEN part of the formula would have to change as it is now returning the wrong value. The formula has to find "LI" and return LI 0000, or DP 0017, or RC 0037 so on. . .
 
Ah, I see. If all your data follows a similar layout, will this work?
=MID(A1,IF(OR(ISNUMBER(FIND({"LI","DP","RC"},A1))),12,LEN(A1)-6),7)

Edit: Nice John! Forgot that AGGREGATE could handle the issue.
 
Back
Top