+ Reply to Thread
Results 1 to 5 of 5

Need better solution for Data Validation formula

  1. #1
    Registered User
    Join Date
    07-17-2017
    Location
    New Jersey
    MS-Off Ver
    2013
    Posts
    56

    Need better solution for Data Validation formula

    Dear Excel Forum users,
    I have a problem that I am struggling to fix I have a drop-down that I want to "disabled" based on data validation formula I wrote problem is I had to edit the formula to add additional criteria and now my formula is too long to enter in the source bar in the data validation box. Is there another alternative to prevent a drop-down from working based on a formula? I have attached below the formula I wrote that is too long, any advice would be greatly appreciated.

    Thanks In Advanced.

    -Avidan

    =IF(AND(B17="ABG Buyer", B17="ABG Advanced Buyer - Admin Only",B17="ABG Advanced Procurement Requestor",B17="ABG Procurement Catalog Administrator",B17=”ABG Supplier Inquiry”,B17=”ABG Enterprise Contract Administrator”,B17=”ABG Contract Manager”,B17=”ABG Enterprise Contact Team Member”),"N/A", 'Data Access'!$A$3:$A$5)

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Need better solution for Data Validation formula

    Hi -

    I can think of a couple things:

    1. If all of your choices begin with "ABG..." why don't you just search on that instead of hard coding all the different possibilities in your formula? So, your formula could look like this:

    IF(B17="ABG*","N/A", 'Data Access'!$A$3:$A$5)

    2. Suppose you have other ABG categories you don't want to match, another alternative would be to put each of your categories into cells and reference those, rather than hardcoding all the text into your formula. For example, if "ABG Buyer" were in cell J1, "ABG Advanced Buyer" in J2, etc. Your formula could be consolidated to:

    IF(AND(B17=J1, B17=J2,B17=J3,B17=J4,B17=J5,B17=J6,B17=J7,B17=J8,"N/A", 'Data Access'!$A$3:$A$5)

    3. Taking option 2 a step further, you could use and ARRAY formula to check that range of values; J1 through J8. That would look like:

    {=IF(SUM(B17=J1:J8),"N/A", 'Data Access'!$A$3:$A$5)}

    Notice the curly braces are added by Excel when you press ctrl-shift-enter from the edit window of the formula.

    Hope that helps.
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Need better solution for Data Validation formula

    You may put un-wanted values in a range ie. (X1:X10), and put "N/A" in Y1
    then use this formula in data validation list.

    =IF(COUNTIF(X1:X10,B17)>0,Y1,'Data Access'!$A$3:$A$5)

    Regards.

  4. #4
    Registered User
    Join Date
    12-03-2012
    Location
    CHENNAI , INDIA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Need better solution for Data Validation formula

    Hi ,

    Another option is to create a table , containing in the first column the category labels , and in the second column have a numeric value from 1 to the number of categories / labels which can be entered in B17.

    Now , the formula becomes a simple :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You can add as many categories as you want to the IF statement , by merely adding them to the table from row 10 downwards , and changing the 8 in the above formula to the new number. Thus , if you add another 5 categories , change the number 8 to 13. That is all.

    See the attached file for the table.

    In fact , you can add all the possible categories that can be entered in cell B17 to this table , and then use the table column Category for data validation in cell B17.

    Narayan
    Attached Files Attached Files
    Last edited by NARAYANK991; 11-08-2019 at 04:14 AM.

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Need better solution for Data Validation formula

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

+ 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. [SOLVED] Data Validation warn for duplicate values to formula solution
    By devi1337 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-01-2018, 02:15 PM
  2. Solution Requied:Data Validation with Condition
    By global5665 in forum Excel General
    Replies: 11
    Last Post: 05-28-2017, 05:21 AM
  3. [SOLVED] Data validation problem/solution !!!
    By sonu1975 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-28-2014, 10:24 AM
  4. Hyperlinking via/from Data Validation List? Only simple solution needed!
    By BrianLabigaliniKCC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2014, 11:29 AM
  5. Excel Formula Solution need for plotting 1D Results from 2D list of data
    By Lee_SequansUK in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-03-2012, 12:05 PM
  6. Need to shorten Data Validation formula in order to fit into formula field
    By V57strat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-27-2012, 05:31 PM
  7. Textbox validation - is there a more elegant solution?
    By madbloke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2009, 08:03 AM

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