+ Reply to Thread
Results 1 to 7 of 7

How to limit the user to enter no more than 2 values.

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    Miami, US
    MS-Off Ver
    Excel 2010
    Posts
    5

    Question How to limit the user to enter no more than 2 values.

    I have 4 cells choosen, (A22, B22, C22, D22) but only one or maximum two cells will be fill with a value. (could be any 1 or any 2 of the four cells)
    Now, I have 2 problems...
    1.- how can I make a formula displaying the average of the value or 2 values entered disregarding the other 2 cells (empty or with a pre determined value of "zero") ?? ======== UPDATE: I received this answer: =AVERAGEIF(A22:D22,"> 0") and it works perfectly so now I now only have one issue left... What can I do to limit the user to only enter 1 or 2 values and somehow block the possibility to enter more than 2 in this 4 cells ??
    Hope you can help me.
    Thanks

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to limit the user to enter no more than 2 values.

    HI Scout51,

    Use below formula in data validation:-

    =COUNTA($A22:$D22)<=2

    See attached:less than or equal to 2 values validation.xlsx


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    Miami, US
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: How to limit the user to enter no more than 2 values.

    Dear Sir, the problem is that the 2 fields allowed are not necesarily the first 2 cells... it can be the 1st and the 4th or the 2nd and the 3rd.. etc etc On the worlksheet that you sent me allow the first two cells (A22, B22) but for example if i choose to fill my 2 values in A22 and C22, it wont allow me to do so...

  4. #4
    Forum Contributor timtim89's Avatar
    Join Date
    01-05-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    141

    Re: How to limit the user to enter no more than 2 values.

    Try this one in your datavalidation for the cells. Please see attachment.

    Please Login or Register  to view this content.

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to limit the user to enter no more than 2 values.

    try

    =COUNT($A22:$D22)<2 - untick the "ignore blank"
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to limit the user to enter no more than 2 values.

    thanks for the rep.
    kindly mark this thread solved.
    thanks.

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to limit the user to enter no more than 2 values.

    if i choose to fill my 2 values in A22 and C22, it wont allow me to do so...
    Hi Scout.. it is allowing, see attached :-

    less than or equal to 2 values validation.xlsx
    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ 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