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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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