I need assistance in validating the following text upon entry into excel 2003 (like a mask within Access): A-1234567. Anyone have any ideas?
Thanks,
Chris
I need assistance in validating the following text upon entry into excel 2003 (like a mask within Access): A-1234567. Anyone have any ideas?
Thanks,
Chris
Do you mean DATA|Validation.
Here you can "force" entries within certain parameters...select custom and enter a formula like =AND(LEFT(A1,2)="A-",ISNUMBER(RIGHT(A1,7)+0),LEN(A1)=9)
this forces left 2 chars to be A- and then have only 7 digits following
where A1 is top most cell you selected to add validation to.
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
A big thank you for the quick response.....two quick questions.....it appears the 'A-" would be the actual data....what would one use to force a letter then the -; and the second question....if A1 is referenced in the formula......does the formula only apply to that particular cell? I need the formula to apply to all cells within a column.
Thanks,
Chris
Last edited by NBVC; 09-03-2010 at 03:17 PM.
Try:
Note: to apply to multiple cells, either preselect all the cells and apply the data validation, where A1 would be the top-left most cell in the selection....or.. apply in one cell and then copy|paste special validation to the other cells..the A1 will update in a relative manner.![]()
=AND(ISERR(LEFT(A1)+0),MID(A1,2,1)="-",ISNUMBER(RIGHT(A1,7)+0),LEN(A1)=9)
Ran into an issue.....when I type a string consisting of any alpha characters as the "A" then the "-" followed by 7 numbers it returns an error....indicating the content is not in the proper format. Any ideas as to what I'm doing wrong? I pasted the formula into the data verification section as custom....starting as "like=.....
Chris
Last edited by NBVC; 09-03-2010 at 03:16 PM.
It worked for me...
Did you alter the formula in any way?
also, please don't quote the entire posts.. just click Post Reply instead of Quote... Thanks.
No...I pasted it as: =AND(ISERR(LEFT(A1)+0),MID(A1,2,1)="-",ISNUMBER(RIGHT(A1,7)+0),LEN(A1)=9)
Within the custom formula box.
Last edited by NBVC; 09-03-2010 at 03:22 PM.
Have a test in the attached, cell A1... are you getting errors there?
You are not entering spaces, correct?
It worked fine in the example......I believe I might have tracked it down......the formula for each cell references A1 only......could it be the formula is only looking at cell A1 for validation? I selected the entire row and applied the formula. If this is the case....how can the formula be applied to the entire row....for each cell within that row easily?
Chris
Select the cell the data validation is working in... and then select the cells you want to copy the validation to.. go to Edit|Paste Special and select Validation... the A1 should autoupdate to the corresponding cells you pasted into.
Another validation.....can't seem to put it together.....need a validation for the following: AAA/AA***** where * could be either alpha or number....got the beginning done....however can't figure out how to represent either a number or letter for the last 7 characters?
if it can be alphanumeric, then you probably don't need anything except then to just check the length of the whole thing is exactly what you want it to be...
so, in addition to your conditions for the first part, add condition like... LEN(A1)=13 or whatever the whole cell length should be...
again... please use POST REPLY button, not QUOTE to respond.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks