IF Statement with Wildcard?

  • Thread starter Thread starter Dan Reynolds
  • Start date Start date
D

Dan Reynolds

Greetings

Is it possible to use the "IF" worksheet function to look at a text field
and return a value if, for example, the text begins with xyz?

something like:

A1 contains the text: smith

A2 has this formula:

=if(A1 starts with "smi", A1,0)

or

=if(A1=smi*, A1,0)

thanks in advance
Dan
 
Well, let's try this again. I presented my follow-up solution:

=IF(AND(A1>"smi",A1<"smj"),A1,"")

which seems to meet your needs, based on what you specifically asked
for in your question.

And I even tested this with other "challenges" presented in other
posts, and this works with troubled, soap, special, squash, stove,
swan, sylvan, and even smith, smithskjdfd, smjidfojvbdfn.

So I present it again, for whatever it's worth. I came up with this
solution because to some people, using this type of formula might be a
little easier to understand than using other functions like LEFT, etc.
Again, just my solution - use it, or use someone else's as desired.

And if I can help further, let me know.

MRO
 
Rafael Ortiz said:
Well, let's try this again. I presented my follow-up solution:

=IF(AND(A1>"smi",A1<"smj"),A1,"")

which seems to meet your needs, based on what you specifically asked
for in your question.

Thanks Rafael

I think you solved my problem with your first solution, but I do like to
have options.

I appreciate your assistance..
Dan
 
Back
Top