+ Reply to Thread
Results 1 to 7 of 7

Help with Data Validation on a cell containing a formula

  1. #1
    Registered User
    Join Date
    03-10-2021
    Location
    Australia
    MS-Off Ver
    365
    Posts
    3

    Help with Data Validation on a cell containing a formula

    Hi all. I'm creating an Excel doc to record students attending an appointment, and to generate a warning if they have already attended once that day. Please see attached.

    A2 = name
    B2 = date
    C2 = A1&B1 (thought concatenate would be easier for data validation)
    Data validation in column C uses COUNTIF($C$2:$C$2000,C2)=1 to detect duplicates. Error alert is set to warning.

    However, it's not generating the warning when I add duplicated data, and I'm thinking it's because of the formula in C1.

    For example, I've entered "Adams J" in A2 and A5, both for 14 November, which should generate the error alert... but it does not.

    Unfortunately this spreadsheet has to sit on Sharepoint so can't contain VBA/macros. Please help! Any advice is appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Help with Data Validation on a cell containing a formula

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    03-10-2021
    Location
    Australia
    MS-Off Ver
    365
    Posts
    3

    Re: Help with Data Validation on a cell containing a formula

    Sorry, no luck. Thank you though.

    It works with the original formula (COUNTIF($C$2:$C$2000,C2) if I type in a duplicate value manually, but I need it to detect the value of the formula automatically.
    E.g. I typed in 'Adams J45244' in C6, and the error message popped up. However it didn't come up when I entered the formula A6&B6 into C6 (which should have given the same result.

    When I enter the same COUNTIF formula in a cell in the spreadsheet, it works correctly to produce 'TRUE' or 'FALSE'. It's just that the 'FALSE' doesn't trigger a data validation error.

    Any other workaround you can think of?
    Last edited by suni_eka; 11-16-2023 at 12:53 AM.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Help with Data Validation on a cell containing a formula

    Using your original formula, the message appears if I enter "=A6 & B6" or "=A5&B5" with A6/B6 empty and duplicate in C5
    Last edited by JohnTopley; 11-16-2023 at 07:24 AM.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Help with Data Validation on a cell containing a formula

    I couldn't get your validation to work yesterday.

    I'd use this in the helper column and not bother with the validation. You can set text colour to red.

    =IF(COUNTIFS(A$2:A2,A2,B$2:B2,B2)>1,"Duplicate!","")
    Attached Files Attached Files
    Last edited by AliGW; 11-16-2023 at 07:24 AM. Reason: Workbook added.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    03-10-2021
    Location
    Australia
    MS-Off Ver
    365
    Posts
    3

    Re: Help with Data Validation on a cell containing a formula

    It worked! Thank you so much Ali, that is a great workaround! I am so thrilled. I'm a novice, learning mostly through Google, so am really grateful.
    JT, thank you also for your time in trying different solutions for me.
    Cheers guys

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Help with Data Validation on a cell containing a formula

    Glad to have helped.

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

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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. data validation and formula in same cell
    By Sybon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2021, 12:31 PM
  2. data validation and formula in same cell
    By Sybon in forum Excel General
    Replies: 3
    Last Post: 06-23-2021, 04:44 AM
  3. Data Validation and formula in same cell
    By VisionSmart in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-04-2019, 03:47 AM
  4. Data Validation - Formula in Cell Not allow any changes
    By loverfellow in forum Excel General
    Replies: 2
    Last Post: 11-11-2015, 10:15 AM
  5. excel formula working on a cell which is having data in a data validation cell
    By sujithy007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-16-2013, 04:18 AM
  6. excel formula working on a cell which is having data in a data validation cell
    By sujithy007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2013, 04:05 AM
  7. [SOLVED] Using formula on a cell with data validation
    By shawnsonline in forum Excel General
    Replies: 6
    Last Post: 08-10-2012, 05:31 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