+ Reply to Thread
Results 1 to 7 of 7

how does this COUNTIF formula work for Data Validation?

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    how does this COUNTIF formula work for Data Validation?

    I needed advice on how to prevent duplicate values appearing in my data. The following formula solves this for me - but I can't find an explanation as to why. Can anyone advise please?

    Under data validation, I added an "allow" "custom" formula "=COUNTIF (C:C,C6)<2" , and it's working - but I don't know why! It has something to do with the "<2".

    Any ideas?
    Thanks
    Steve
    Last edited by 6StringJazzer; 03-30-2018 at 07:21 AM.

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: This formula solves my problem, but HOW?

    The formula counts how many occurences of the value in C6 exists in the range C:C. 1=unique, 2 and over 2 = duplicates. So <2 part is saying that it will allow only unique entries.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: This formula solves my problem, but HOW?

    Your post does not comply with Rule 1 of our Forum Rules. Please update your title to tell us something about your specific question. Describe your problem, not your anticipated solution. We ask this for two reasons:

    1. Members scan the list of threads to decide where they can help. The title helps us decide which questions we have the knowledge to solve.
    2. After a question is answered, the title helps people with similar questions find it in a search.

    Use terms appropriate to a Google search. Examples of poor thread titles are Please Help, Urgent, Need Help, Formula Problem, Excel Question, Code Problem, and Need Advice.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    01-28-2014
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5
    Quote Originally Posted by PaulM100 View Post
    The formula counts how many occurences of the value in C6 exists in the range C:C. 1=unique, 2 and over 2 = duplicates. So <2 part is saying that it will allow only unique entries.
    Thanks. Is that documented somewhere ? Not at all
    Obvious..

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: This formula solves my problem, but HOW?

    Quote Originally Posted by 6StringJazzer View Post
    Your post does not comply with Rule 1 of our Forum Rules. Please update your title to tell us something about your specific question.
    It's still a poor title. I gave up and changed it for you but please give this serious thought next time you start a thread.

  6. #6
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: how does this COUNTIF formula work for Data Validation?


  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: how does this COUNTIF formula work for Data Validation?

    Quote Originally Posted by srush View Post
    Thanks. Is that documented somewhere ? Not at all
    Obvious..
    It is documented everywhere.

    How To Prevent Duplicate Entries In A Column In Excel Using Custom Data Validation and COUNTIF

+ 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. Macro solves the mathematical expression
    By MrObvious in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2014, 03:10 PM
  2. Creating a new function which solves m for which ErlanCsrv = 95% (Erlang)
    By SHUTTEHFACE in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-10-2014, 03:29 PM
  3. VBA code that solves a heat transfer grid problem
    By c5vette13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2013, 10:46 PM
  4. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  5. please help with a formula that solves the problem
    By rajansood in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2013, 09:31 AM
  6. Formula Links Formula and solves for cell??
    By Zees in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-27-2010, 05:02 PM
  7. $5 (£3.25) if you can create the macro that solves this problem!
    By Captain Useless in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2010, 07:57 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