Custom Validation Formula

Mbourque94

New Member
Joined
Jun 11, 2017
Messages
7
I need to create a custom formula for a validation test with the requirement being 4 digits and a value within the range of 1000 and 6900. This could be simply accomplished by using whole number range and specifying the values, as it would be impossible to have an entry that was not 4 digits using whole numbers only. The requirements however specifically require a custom formula, which I have been trying and failing with for the past hour and a half. PLEASE HELP!!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi welcome to the board :)

TRy this...
=AND(A1>=1000,A1<=6900,LEN(A1)=4)
The requirements however specifically require a custom formula
and what requirements would they be?
 
Last edited:
Upvote 0
Aladin, any decimal value with 4 digits will be less than 1000 and any decimal > 1000 with a decimal will be > 6900, that's why I just used LEN() :)
 
Upvote 0
Thanks for the quick response. All that is stated for specific instructions is " Create a custom data validation in cells J19:J23 that accept entry only if four digits in length and in a range from 1000 to 6999."
 
Upvote 0
No it isn't homework. I start a new job next week so I have been working on excel assignment from an accounting course I took last year to be better prepared for the amount I will rely on excel for the job.
 
Upvote 0
I just tried both of them. They allow me to enter "999" which should prompt an error message if the rule was operating. Since I am using the cell range of J19:J23 I tried modifying the formula to =AND(J19:J23>=1000,J19:J23<=6900,LEN(J19:J23)=4 but I must have made a mistake because it will not accept the formula.
 
Upvote 0
With a test for LEN()=4, you will not be able to enter 999, perhaps you applied it incorrectly?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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