+ Reply to Thread
Results 1 to 6 of 6

Data validation to keep a prefix

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Data validation to keep a prefix

    I am creating a budget tracker that will have a couple of cells for miscillaneous spend. The information in these cells has to start z.1 Furniture, z.2 Racking etc.

    I would like to allow people to specify what the item is by typing in the cell e.g. if i had a budget for cuddly toys i would want them to type into the cell Z.3 Cuddly Toy

    What im trying to get round to saying is that is there a way that i can use data validation on a specific cell so that any information typed in that celll has z.x at the start.

    Many thanks,

    Chemist
    Attached Files Attached Files
    Last edited by Chemistification; 07-08-2010 at 11:19 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data validation to keep a prefix

    Maybe try custom formula:

    =AND(LEFT(A1,2)="Z.",ISNUMBER(MID(A1,3,2)+0),OR(MID(A1,4,1)=" ",MID(A1,5,1)=" "))

    This checks first 2 chars are Z., checks that the next 2 characters (incl. space, if single digit number) is a number when coerced to a number, and checks that there is a space before the typed word.
    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.

  3. #3
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: Data validation to keep a prefix

    That works perfectly NBVC. Thanks for the help.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Data validation to keep a prefix

    If you could use two columns

    Try
    DataValidation In Column A > List > Source
    Furniture,Racking,SomethingElse

    In Column B
    ="Z."&ROW()&"."&A1
    Fill/Drag Down to suit

    Demo workbook attached

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: Data validation to keep a prefix

    Ok cool cheers Marcol. Both are very nice methods of solving the problem. Thanks to you both

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Data validation to keep a prefix

    Might be better in the demo workbook in B1
    =IF(A1<>0,"Z."&ROW()&"."&A1,"")
    Fill/Drag Down

    If it's of at all of use to you.

    Cheers
    Alistair

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1