Data Validation - Only allowing numbers and "+" si

supergoat

New Member
Joined
Apr 15, 2005
Messages
12
Hi,

I need to only allow numbers a plus sign '+', and spaces into a cell. This is so that it can be used for international telephone numbers e.g. +44 666 8745.
Any ideas how I restrict the values?

Many Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Re: Data Validation - Only allowing numbers and "+&quot

supergoat said:
Hi,

I need to only allow numbers a plus sign '+', and spaces into a cell. This is so that it can be used for international telephone numbers e.g. +44 666 8745.
Any ideas how I restrict the values?

Many Thanks

You need to pre-format the cells you want to data validate, then set up custom data validation with as formula:

=ISNUMBER(SUBSTITUTE(D1," ","")+0)

where D1 is such a cell.
 
Upvote 0
Thanks,

But i can't really follow it.
I have just one cell that will contain both '+' ad numbers.
What do I need to put in the format cells - custom format - 'type' box?
Does D! refer to my cell where data entry will take place?
 
Upvote 0
supergoat said:
Thanks,

But i can't really follow it.
I have just one cell that will contain both '+' ad numbers.
What do I need to put in the format cells - custom format - 'type' box?
Does D! refer to my cell where data entry will take place?

Lets say that you want to data validate D1:D10...

Select D1:D10.
Activate Cells|Format and choose Text.
Activate Data|Validation.
Choose Custom for Allow.
Enter in the formula box:

=ISNUMBER(SUBSTITUTE(D1," ","")+0)

Click OK.

Start entering phone numbers with + and spaces in D1 onwards.
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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