Custom Data Validation

bandit_1981

Board Regular
Joined
Aug 17, 2005
Messages
201
Hello all I am currently using this custom validation.

Code:
=AND(LEN(D6)<=8,OR(RIGHT((D6),1)="%",MOD(D6,1)=0))

Now i need to update it to also allow for "." so they can have decimals in their percentage. Any Ideas. I tried putting

Code:
=AND(LEN(D6)<=8,OR(RIGHT((D6),1)="%",OR val(FIND(D6,".")) > 0 ,MOD(D6,1)=0))
But this doesnt work
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
It works but if i type say 6.5% in the cell it whipes it out for some reason. It doesnt give an error it just whipes the cell.
 
Upvote 0
It appears as if you use text for the format it wont supoort both the "." and the "%" sign in the same cell. General will but it auto converts it to percentage format which wont work for what i need. hmm....
 
Upvote 0
Hmmm.

I tried the exact same validation and used your example and it works just fine.

If I remember correctly, I helped you on the initial validation a while back and I think your cell format must be Text to work properly. Is that what you have?

Even if it's not in text, which it should be, I can't see any reason for it to wipe out your entry and not give any error if your data validation is set. Do you have some sort of macro in the sheet that may be invoked and is clearing certain entries?

Perhaps try in the validation in another cell or other sheet just to see.

Let me know.
 
Upvote 0
Yeah you did help me on the orginal one as well. I have my format set to text. I just tried it on a blank sheet and it works it must be messing with one of my formula and it is getting cleared out by it.

Thanks again
Dan
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,577
Members
449,039
Latest member
Arbind kumar

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