Allowing restricted decimal values in a cell

srilam

New Member
Joined
Apr 11, 2007
Messages
12
Dear,

I have a requirement to allow only .5 for any number. say for eg; in cell A1, i can allow 12.5 or 6.5 and not other decimals like 12.4 or 12.8 etc. Need to restrict the end user with a alert message also.

I tried with making the cell as decimal but couldnot restrict the user in entering beyond .5

is there any formula and not VBA code possible to restrict and alert user.

Thanks, Srikanth
 

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
Go to Data Validation under "Data" -> Choose Custom then enter in the formula

=A1-INT(A1)=0.5


change your messages (input message and error alerts)
 
Upvote 0
Why not use Data Validation
select Custom from the Allow list and input this formula
Code:
=MOD(A1,0.5)=0

You can then add entry and alert messages to suit via the Data validation Options
 
Upvote 0
You could use data validation with this formula:

=AND(ISNUMBER(A1),MOD(A1,1)=0.5)

but be aware that a user can paste any data to A1 and destroy the validation. VBA could provide a more robust solution, but I understand you don't want a VBA solution.
 
Upvote 0
Hey All

Thanks for your quick replies. it worked. thanks for your support

Joe, I understand, currently we have some technical issues on vba plugins that is why this turnaround

Srikanth
 
Upvote 0

Forum statistics

Threads
1,215,741
Messages
6,126,608
Members
449,321
Latest member
syzer

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