0

Trying to get my head around an IF statement (which generally speaking I'm normaly OK at!)

The example would be Sheet name 201401_ABC123_XYZ

I bascically want to say if the text after the first _ reads ABC123 then return the value 123 else return 456.

Any help would be appreciated

thanks Jim

2
  • 1
    Sorry, but what exactly is the conditon in plain words? Do you want to evaluate the sheet name? Can you explain the context? An IF statement normally looks at cells, not sheet names. Or is what you call a "sheet name" a text in a cell? What are you trying to accomplish? Commented Oct 8, 2014 at 10:24
  • 1
    @Jim question is not clear enough. See this Commented Oct 8, 2014 at 11:07

1 Answer 1

1

Consider Cell A1 has your text i.e. "201401_ABC123_XYZ"

=IF(MID(A1,FIND("_",A1)+1,6)="ABC123","123","456")

Here 6 is length of your string you want to search for i.e. "ABC123" "ABC123" - is your string you want to search for and 123 and 456 is string you want to return as per your question.

Hope this will help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.