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

If function, finding a match on the last 3 characters

I have got the following formula that looks at a cell, and if it contains the characters "IDE" anywhere on the text then it puts a "Y" on the column, otherwise an "N".

=IF(COUNTIF(J1021, "*IDE*"),"Y", "N")

What I want to do is actually modify this formula so it only puts a "Y" on the cell if the last 3 characters of the cell are "IDE", not just a match anywhere.

That way I can have something like this.

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

enter image description here

>Solution :

Using RIGHT() Function

FORMULA_SOLUTION

• Formula used in cell B1

=IF(RIGHT(A1,3)="IDE","Y","N")

You can also do a BOOLEAN LOGIC here,

BOOLEAN_LOGIC

• Simply enter the formula in cell C1

=(RIGHT(A1,3)="IDE")*1

And then Custom format the cell by pressing CTRL + 1 –> Format Cells –> Number Tab –> Category –> Custom –> Type –>

[=1]"Y";[=0]"N";

But note the cells will show 1 for a TRUE value & 0 for a FALSE value.

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