Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2022, 07:51 AM
IamThatGuy IamThatGuy is offline multiple validation on a column to avoid duplicate entries Mac OS X multiple validation on a column to avoid duplicate entries Office 2021
Novice
multiple validation on a column to avoid duplicate entries
 
Join Date: Feb 2022
Posts: 14
IamThatGuy is on a distinguished road
Exclamation multiple validation on a column to avoid duplicate entries

In the attached, tab 'Working'...

is there a way to:
  • Add validation so duplicate entries are not allowed. Would normally use Data validation for this but this is already being used
  • Restrict users from typing into column A. i.e. be forced to use the Drop down only



Thank you in advance
Attached Files
File Type: xlsx IDExample.xlsx (14.4 KB, 8 views)
Reply With Quote
  #2  
Old 02-23-2022, 01:19 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline multiple validation on a column to avoid duplicate entries Windows 7 64bit multiple validation on a column to avoid duplicate entries Office 2010
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,777
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Have you posted the same on other forums as you did previously?
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 02-23-2022, 01:27 AM
IamThatGuy IamThatGuy is offline multiple validation on a column to avoid duplicate entries Mac OS X multiple validation on a column to avoid duplicate entries Office 2021
Novice
multiple validation on a column to avoid duplicate entries
 
Join Date: Feb 2022
Posts: 14
IamThatGuy is on a distinguished road
Default

Fair question.

No, I am sticking to this forum only. If that's OK
Reply With Quote
  #4  
Old 02-23-2022, 06:30 AM
ArviLaanemets ArviLaanemets is offline multiple validation on a column to avoid duplicate entries Windows 8 multiple validation on a column to avoid duplicate entries Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

Your unique numeric entries are entered into column A of sheet Working. And probably you have a header (a string) for this column too.
On some hidden sheet (e.g. Hidden), into some cell (e.g. A1) enter formula, which calculates next unique value, like
Code:
=MAX(Working!$A:$A) +1
Create a Name (e.g. nNextID), which refers to cell with formula
Code:
nNextID = Hidden!$A$1
Activate any cell (e.g. A2) on sheet Working, and create a Name (e.g. nCurrID), like
Code:
nCurrID = Working!$A2
I.e. the Name returns the value of column A of active row in sheet Working. Such Names are referred to as Dynamic Names.
Create a Name (e.g lIDList), like
Code:
lIDList = IF(nCurrID = "", nNextID, nCurrID)
For column A of sheet Working (for Datarange of this column), create a Data Validation List based on lIDList. Like
=lIDList

Now, whenever you activate this Data Validation List on sheet working, when the cell has any ID value entered previously, this value is only option, and when the cell is empty, the next ID value is the option.

You can also add another IF() level for lIDList, which checks is the active cell in column A, and when not, returns some error message instead ID value.
Reply With Quote
  #5  
Old 02-23-2022, 07:32 AM
kilroyscarnival kilroyscarnival is offline multiple validation on a column to avoid duplicate entries Windows 10 multiple validation on a column to avoid duplicate entries Office 2019
Expert
 
Join Date: May 2019
Posts: 345
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

ArviLaanemets, I tried yours and it works! Thanks for the concept; I may have a different use for it.

Back to IAmThatGuy's question, I think you answered it perfectly. However, I'm wondering whether having to dropdown each number is just making it rather fiddly for users.

Guy, I'm presuming that you are trying to make sure no numbers are skipped and no numbers are duplicated. Is there another reason you wanted to use a dropdown? I think from your example that your numbering will always be in regular sequence?

This is rather simplistic compared to Arvi's elegant response, but I have an issue with a coworker's worksheet for tracking items. He wants to hide the rows of projects that are completed, but sometimes because it's hidden, he ends up re-entering it, or reusing the record number.

I've applied a numbering column where the column's cells are locked, and where the numbers don't show up until he starts to type content in the next (B) column.

First number cell =IF(B2="","",1)
Subsequent number cells =IF(B3="","",MAX(A$2:A2)+1)
The latter, when filled down, becomes =IF(B17="","",MAX(A$2:A16)+1) etc.

I also apply conditional formatting to the column containing the project number, just your basic pink background/red text default one. So if he starts typing in a project that is either above, or better yet, on a hidden row, he's got a clue that he already has the information, and can check it. It doesn't prohibit him from entering it; but the next time he passes it to me to update it I can check why there are duplicates.
Reply With Quote
  #6  
Old 02-23-2022, 08:49 AM
IamThatGuy IamThatGuy is offline multiple validation on a column to avoid duplicate entries Mac OS X multiple validation on a column to avoid duplicate entries Office 2021
Novice
multiple validation on a column to avoid duplicate entries
 
Join Date: Feb 2022
Posts: 14
IamThatGuy is on a distinguished road
Default

Thanks, I have tried the steps but I am still able to enter duplicate values

and

enter text into the fields rather than only being allowed to select a value from the drop-down.

I have attached the updated sheet. Have I gone wrong somewhere?

Thanks in advance

Quote:
Originally Posted by ArviLaanemets View Post
Your unique numeric entries are entered into column A of sheet Working. And probably you have a header (a string) for this column too.
On some hidden sheet (e.g. Hidden), into some cell (e.g. A1) enter formula, which calculates next unique value, like
Code:
=MAX(Working!$A:$A) +1
Create a Name (e.g. nNextID), which refers to cell with formula
Code:
nNextID = Hidden!$A$1
Activate any cell (e.g. A2) on sheet Working, and create a Name (e.g. nCurrID), like
Code:
nCurrID = Working!$A2
I.e. the Name returns the value of column A of active row in sheet Working. Such Names are referred to as Dynamic Names.
Create a Name (e.g lIDList), like
Code:
lIDList = IF(nCurrID = "", nNextID, nCurrID)
For column A of sheet Working (for Datarange of this column), create a Data Validation List based on lIDList. Like
=lIDList

Now, whenever you activate this Data Validation List on sheet working, when the cell has any ID value entered previously, this value is only option, and when the cell is empty, the next ID value is the option.

You can also add another IF() level for lIDList, which checks is the active cell in column A, and when not, returns some error message instead ID value.
Attached Files
File Type: xlsx IDExample.xlsx (16.1 KB, 6 views)
Reply With Quote
  #7  
Old 02-23-2022, 08:52 AM
IamThatGuy IamThatGuy is offline multiple validation on a column to avoid duplicate entries Mac OS X multiple validation on a column to avoid duplicate entries Office 2021
Novice
multiple validation on a column to avoid duplicate entries
 
Join Date: Feb 2022
Posts: 14
IamThatGuy is on a distinguished road
Exclamation

Quote:
Originally Posted by kilroyscarnival View Post

I've applied a numbering column where the column's cells are locked, and where the numbers don't show up until he starts to type content in the next (B) column.

First number cell =IF(B2="","",1)
Subsequent number cells =IF(B3="","",MAX(A$2:A2)+1)
The latter, when filled down, becomes =IF(B17="","",MAX(A$2:A16)+1) etc.
Thanks for this but this does not work if someone decides to insert a line in the middle of the data
Reply With Quote
  #8  
Old 02-23-2022, 11:24 AM
ArviLaanemets ArviLaanemets is offline multiple validation on a column to avoid duplicate entries Windows 8 multiple validation on a column to avoid duplicate entries Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

Quote:
Originally Posted by IamThatGuy View Post
Thanks, I have tried the steps but I am still able to enter duplicate values and enter text into the fields rather than only being allowed to select a value from the drop-down.
Have you set only Data Validation List values to be allowed (this is a default setting, but there is a possibility to change this)?
Anyway, I haven't access to MS Office until Friday, so I can't check out your attached workbook currently.
Reply With Quote
  #9  
Old 02-25-2022, 03:19 AM
IamThatGuy IamThatGuy is offline multiple validation on a column to avoid duplicate entries Mac OS X multiple validation on a column to avoid duplicate entries Office 2021
Novice
multiple validation on a column to avoid duplicate entries
 
Join Date: Feb 2022
Posts: 14
IamThatGuy is on a distinguished road
Default

Quote:
Originally Posted by ArviLaanemets View Post
Have you set only Data Validation List values to be allowed (this is a default setting, but there is a possibility to change this)?
.
Yes, I have checked that under Data validation but that does not seem to be problem.
Appreciate if you are able to check? Thank you
Reply With Quote
  #10  
Old 03-01-2022, 12:32 PM
IamThatGuy IamThatGuy is offline multiple validation on a column to avoid duplicate entries Mac OS X multiple validation on a column to avoid duplicate entries Office 2021
Novice
multiple validation on a column to avoid duplicate entries
 
Join Date: Feb 2022
Posts: 14
IamThatGuy is on a distinguished road
Default

shameless bump/ Any takers please?
Reply With Quote
  #11  
Old 03-07-2022, 06:15 AM
IamThatGuy IamThatGuy is offline multiple validation on a column to avoid duplicate entries Mac OS X multiple validation on a column to avoid duplicate entries Office 2021
Novice
multiple validation on a column to avoid duplicate entries
 
Join Date: Feb 2022
Posts: 14
IamThatGuy is on a distinguished road
Default

Found the solution here" VBA to auto-generate a task ID (Unique and sequenced) | MrExcel Message Board
Reply With Quote
Reply

Tags
data validation, duplicate entries



Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple validation on a column to avoid duplicate entries How to avoid duplicate table headers while mail merge records? everwisher Mail Merge 2 01-04-2019 04:50 AM
Can Excel find Duplicate entries when only part of the cell's data is a duplicate of another cell? jsisley Excel 1 07-21-2017 09:20 AM
Duplicate entries yourforester Outlook 1 11-15-2014 10:44 PM
Calendar - Duplicate Entries castow Outlook 0 02-05-2014 02:53 PM
How Can I Flag Duplicate Date Entries? tatihulot Excel 5 11-16-2012 12:19 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft