Re: indetify 5 digit numbers

Jimbo Razza

Board Regular
Joined
May 21, 2005
Messages
114
Re: indetify 5 digit numbers

Hey There

I have a cell that could have text, numbers or a combintation of the two in it.

I need to check the cell and create a condition if it has a 5 digit number in it.

How would I do this?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

hsk

Well-known Member
Joined
Oct 19, 2006
Messages
567
Try ........
=IF(AND(ISNUMBER(A1),A1>9999)=TRUE,"Yes","No")

This will be true for all numbers of 5 or more digits ........
If u want the number to be ONLY 5 digits then

=IF(AND(ISNUMBER(A1),Len(A1)=5)=TRUE,"Yes","No")
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
By 5 digit number, I'm assuming 900.5 would not qualify.

Perhaps:
=IF(AND(TRUNC(N(A1))=A1,LEN(A1)=5),"Yes","No")
 

Forum statistics

Threads
1,181,658
Messages
5,931,272
Members
436,786
Latest member
Deniel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top