• 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.

Find function combined with "if not found then do this. .

Weldon

New Member
My find function is =MID(G5,FIND("LI",G5),7), but what can be done if "LI" is not found and I want to return a value of =right(G5,7)?
 
Try 'wrapping' your formula in an IFERROR - for example
=IFERROR(MID(G5,FIND("LI",G5),7),right(G5,7))

I tried it on a very quick & dirty sample and it appeared to work - however, beware that if your error is not generated by a missing "LI", this formula will return right(G5,7) ... but I can't see anything there that would produce that ...
 
To handle the issue that David brought up (not sure if it's actually possible, but just in case)
=MID(G5,IFERROR(FIND("LI",G5),LEN(G5)-6),7)
 
Back
Top