If + and + len?

cjvenables

Board Regular
Joined
Aug 2, 2011
Messages
65
Hey guys,

I need a formula that will check if what is in C2 is 7 digits, but does not equal 7 characters. If it equals 7 numbers, I want it to return, "7 Numbers", if not, "NOTHING"

Here is the formula I am working with:

=IF(LEN(C2)=7,"7 Digits","NOTHING")

This works for everything, but when a cell had 7 letters (CLEANFX), it would return 7 digits. I need something that only finds 7 numbers. I am probably using the wrong formula?

I tried to use this formula, but it returned CLEANFX, but not the cells that had 7 numbers.

=IF(AND(LEN(C4)=7,C4="CLEANFX"), "7 Digits", "NOTHING")

Thanks for the help!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You can check if its a Number with "ISNUMBER()"

=IF(AND(LEN(C2)=7,ISNUMBER(C2)),"7 Digits","NOTHING")
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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
Back
Top