I'm making an excel sheet for a group of people to work from. They will be adding entries identified by a unique alphanumeric string. I would like the entry of a repeated string to result in an error message, or ideally in the new entry overwriting the old.
Thanks for the help.
Using data validation.
Highlight all the cells from the second row to the bottom of the page. Click data validation on the data tab. Choose Custom and put in the following formula:
=ISERROR(MATCH($A2,$A$1:$A1,0))
Changing A to the column you want.
Now when I try to type a duplicate I get an error and cannot proceed till I fix it:
Related
Think I might be reaching a bit here, but I’m trying to find a way of sending / submitting cell values in excel to other cells. Here’s the example;
In a cell I have a car name
I’ve set my workbook up to use this cell as a field to enter data and the system calculates where what I enter into a separate table, and returns a confirmation that the car I want to look for exists. I might then delete the data in the field to repeat the search. Here’s what I’m trying to solve…
If the car doesn’t exist, I want to somehow send or copy the data from the field (by clicking something or a formula) and send it into another table automatically to list as “cars that were searched for but didn’t exist” type area, how could I do this?
Many thanks
I have three excel spreadsheets and I don't how to do anything with excel. I need to find a way to associate IDs from one column to another column.
I have a column called "Display Name" and I have 2 columns in another worksheet called "IDs" and "Display name".
I want to compare the "Display names" from the first spreadsheet to the "Display names" on the second spreadsheet. I then I want to pull all the ids and match them based on there name. I have over 1000 and don't want to do this manually.
I copied the IDs to the first worksheet. Here is a picture of what I am trying to do:
Any ideas or links to help me get started would be awesome. I literally don't know anything about excel. I tried vlookups but I kept getting either a name error or a ref error.
Thanks for your time,
Try INDEX()/MATCH() like-
=INDEX(O:O,MATCH(A2,P:P,0))
So I'm working on a google sheet project where I and a few others will be keeping track of every movie we watch and then scoring it from 1-10. Since this is a long-term project, the list of movie titles will get quite long and I'm trying to think of a way to notify the inputter if the movie title they're writing already exists further up in their column. Assuming it's an if-statement of some sort but very new to excel and google sheets.
Anyone have any ideas?
You might try to create validation rule for the range of cells. Right button click on the cell -> Data Validation...
Or see the link below for details
Google sheet value validation
Same solution might be implemented for MS Excel sheets
I have used conditional formatting for this. Lets say movie names are in column A. The below code would highlight duplicate entries.
=COUNTIF(A:A,A1)>1
The only issue is if there is a Typo in the movie name you could still end up whit duplicates. Example
I am building a multilevel dependent dropdown structure in Excel based on a parent-child structure. Building this with vba is not a problem but the problem is reopening the file. It removes the validation because they have too many characters (more than 255?)
The generated validation strings are too long for Excel to store so they are removed after reopening.
A solution could be to write the validation string in a cell and base the validation on this cell value. Only problem is when i link the data validation to this cell its only one option.
the value in the cell is something like A,B,C,D (already tried with or without "")
Does anyone have a suggestion for an excel formula to use in the data validation to generate multiple options from a string like A,B,C,D located in one single cell.
TNX for the support.
The solution was a bit more difficult.
I was able to make it work but only by combining VBA and Excel Formulas. Also i added a value to the dataSource with both the id and optionid in it.
Excel:
For The data validation i use an fuction who utilizes an offset which is dynamic and based on 2 values. This way i dont get the error that a validation is more than 255 characters.
data validation formula:
=OFFSET(List!$A$2;MATCH(CONCATENATE(V18;"|";E18);List!$F:$F;0)-2;1;COUNTIF(List!$F:$F;CONCATENATE(V18;"|";E18)))
One is for the id and one is the optionid.
VBA:
I now use the on change event to produce the values needed for the dropdowns(data validation) but not letting vba insert the values for the data validation. It gets these values via a pre-loaded array which is started with a workbook_open event. (if this isnt loaded it will load it again).
When i select an item it writes the id and optionid to a different cell. I then use these to produce the next dropdowns etc with the offset function. (one dropdown can result in multiple rows of new dropdowns)
Also added some functionality for delete and change (in the middle) events.
Also the onChange event now triggers the next dropdown and write its value if there is only one option. This will of course trigger the next.
I'm changing an old Excel spreadsheet and have got a user-request to add a drop-down list to a date selection field.
Data Validation is already turned on for the cell in question with a "<=TODAY()" clause (the sheet contains information on production efficiency, no idea going forward since data is not there).
The user requests a drop-down listing the past seven days. I can make a list and enumerate it in VBA, but I am having difficulties coming up with a way to apply a drop-down list to a cell without using Validation.
Is this possible?
Here are some ways you can try:
Add a datepicker to the cell (and keep the formula validation you put)
a. See some standard way on MSDN
b. or with an addin on this blog
Change dynamicaly your validation to a dropdown list when the Workbook is opened or the worksheet activated with an event procedure and add another event procedure OnChange to check if the value entered is before today.
Why not replace the existing data validation rule with a list rule? Just create a new sheet and enter in A1:A7
=TODAY()
=A1-1
...
=A1-6
Then set your data validation rule to "List" and set the Source to A1:A7 on the new sheet. Then hide the sheet just to keep it out of the way. This should preserve the old validation requirement.