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 Last 2 Digits Of Cell Value Are Greater Than And Less Than

I’m trying to figure out the correct syntax for the following formula.

I have a Named Range "Width" which is always a 3 digit value eg.126,298,300,495 etc.

If the last 2 digits of the value from Named Range "Width" is greater than or equal to 00 and less than or equal to 49 then return "True" else "False"

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

=IF(AND(RIGHT(Width,2)>=00,(RIGHT(Width,2)<=49)),"True","False")

Hope someone can help me out with this.

Thanks in advance.

>Solution :

The issue you have is that RIGHT returns a string, which you are then comparing to a numeric. Also, it’s generally preferable to return Boolean TRUE/FALSE results, rather than text entries like "True" and "False". So:

=AND(0+RIGHT(Width,2)>=0,0+RIGHT(Width,2)<=49)

FYI you could also consider the simpler:

=ISEVEN(QUOTIENT(Width,50))

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