ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to make IF logical expression equal to any 5 digit value (https://www.excelbanter.com/excel-programming/288980-how-make-if-logical-expression-equal-any-5-digit-value.html)

yalex

How to make IF logical expression equal to any 5 digit value
 
I wanted to see if there is any way to make the logical expression of an
IF statement equal to any 5 digit value.

Ex: =IF(B2=?????, ....

If the value in B2 is a 5 digit value then it is true and false if it
is not.

-yalex


---
Message posted from http://www.ExcelForum.com/


Chip Pearson

How to make IF logical expression equal to any 5 digit value
 
Try something like the following formula:

=IF(AND(ISNUMBER(B2),LEN(B2)=5),"yes","no")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"yalex " wrote in message
...
I wanted to see if there is any way to make the logical

expression of an
IF statement equal to any 5 digit value.

Ex: =IF(B2=?????, ....

If the value in B2 is a 5 digit value then it is true and false

if it
is not.

-yalex


---
Message posted from http://www.ExcelForum.com/




yalex[_2_]

How to make IF logical expression equal to any 5 digit value
 
Thanks a lot. Worked perfectly

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com