Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I add a wildcard to my if formula (that also contains an or condition)

I have a column of locations on an Excel file, and some of the locations can be named something like this

enter image description here

So what I want to do with my formula is say, if the last 3 characters are "IDE" or, if the last 5 characters are "IDE-(and a wildcard) then add a "Y" to the column otherwise add an "N".

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I have the following formula, but even though the location is MyLocation IDE-1 it is still giving me an "N" and I’m not sure f what I am doing wrong

=IF(OR(RIGHT(L1,3)="IDE", RIGHT(L1,5)="IDE-"&"*"),"Y","N")

>Solution :

Try:

enter image description here

Formula in B1:

=IF(SUM(COUNTIF(A1,{"* IDE","* IDE-?"})),"Y","N")

Or, a little less verbose:

=IF(SUM(COUNTIF(A1,"* IDE"&{"","-?"})),"Y","N")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading