+ Reply to Thread
Results 1 to 5 of 5

Data Validation for multiple product codes

  1. #1
    Registered User
    Join Date
    10-11-2018
    Location
    Winnipeg, Manitoba
    MS-Off Ver
    2013
    Posts
    2

    Data Validation for multiple product codes

    I have two types of product codes V###### and C######. All codes are six digits with either a "C" or "V" in front. I want to set the data validation to allow for either the "V" or "C" followed by six digits. The formula I am currently using is =AND(LEFT(I3,1)="V",LEN(I3)>6). However, this only allows for the V###### to be used. I cannot figure out how to add an additional formula to allow for the "C" to be used as well. Can anyone help?

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Data Validation for multiple product codes

    Hello and welcome to the forum.

    Try this:

    =AND(OR(LEFT(I3,1)="V",LEFT(I3,1)="C"),LEN(I3)>6)

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Data Validation for multiple product codes

    Note that you can remove the ",1" parts of the LEFT function since omitting them defaults to 1.

    Also, you might consider changing >6 to =7 to not allow something like this: V1234567

  4. #4
    Registered User
    Join Date
    10-11-2018
    Location
    Winnipeg, Manitoba
    MS-Off Ver
    2013
    Posts
    2

    Re: Data Validation for multiple product codes

    Thank you so much. I have been trying so many versions of OR formulas. I was very frustrated. It works. I couldn't be happier.

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Data Validation for multiple product codes

    Great, happy to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 05-20-2017, 03:27 PM
  2. [SOLVED] (Urgent help) Replacing Product codes with Product name
    By yash.kedia in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-21-2016, 06:17 AM
  3. Replies: 3
    Last Post: 12-24-2014, 04:52 PM
  4. [SOLVED] Generating product id codes from multiple columns with arguments - No VBA
    By huwtre in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-25-2014, 11:27 AM
  5. Data from two sheets, same product codes, match into a new sheet
    By schroeders12 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2014, 10:42 AM
  6. Replies: 0
    Last Post: 10-01-2012, 02:57 PM
  7. How can I use any one of multiple codes to lookup a product name?
    By Gelb1472 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-14-2012, 08:08 PM

Tags for this Thread

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