I have a problem when setting up an excel data validation list on an existing table :
There are existing records that were filled before the addition of data validation list, and new ones that are added using the dropdown list.
The problem I have is that excel doesn't recognize some values as the same if they were from the existing table (that was created without the data validation list) and if they are created with the dropdown list :
Example : In my dropdown list, I have Option A, but when filtering on the column, Excel shows Option A Option A (one for the old data, one for the new).
The only fix i found to this is to manually select values from dropdownlist for old data to be considered as the same (but it is not a viable solution as there are too much to change).
The issue was that there were 'false' spaces (ASCII 160) which is why there was a difference between two seemingly exact strings.
Ctrl+H on the colum and replace Alt +160 per " " solved this.
Related
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:
I have an excel file with two sheets. The second sheet (Report) contains data validation cells based on the first sheet (Data). From the second sheet, the drop-down list that displays in the Select XXX depends on the selection in the Generate Report. When the Generate Report is set to anything beyond the first five in its list, the "Select XXX" displays year as a default list (no problem with this) via the code ...INDIRECT("Year").... The problem is that excel does not allow for addition of more code (seems I hit the limit). The question is - how can I manipulate this code to accommodate every option in the Generate Report? or perhaps, is there another method to implement?
The data validation source code for the drop-down list is =IF($B$4=Data!$Q$5,INDIRECT("Client"), IF($B$4=Data!$Q$6,INDIRECT("Month"), IF($B$4=Data!$Q$7,INDIRECT("Product_Service"), IF($B$4=Data!$Q$8,INDIRECT("Sector"), IF($B$4=Data!$Q$9,INDIRECT("Trans_Type"),INDIRECT("Year"))))))
Please, see the sample file at https://drive.google.com/file/d/1VKkGHjlJzLQqx4J9kyd_bCKG4r0Q7HkG/view?usp=sharing
What you could do is put the range names in column R, and VLOOKUP them:
=IFERROR(INDIRECT(VLOOKUP($B$4,Data!$Q$5:$R$9,2,FALSE)),INDIRECT("Year"))
You could then have as many item lists as you wish.
I have come across numerous definitions of how Excel adds the field into a pivot table when selected, for example:
You can quickly add fields to your pivot table by using the check box next to the field name from the field list in the PivotTable Fields window. This can save time if you have a lot of fields to add instead of dragging and dropping each item. Fields containing text data will be added to the Rows section and fields containing numeric data will be added to the Values section when using the check box.
Source: howtoexcel.
However, here's a ten-second video showing that this is wrong -- at least in my case using Excel on Mac:
https://gyazo.com/f299b74d6f6fa4d74737e3f88362538c
Adding a float does a sum (makes sense), adding a text field does a count (??), adding an integer does a row aggregation (??), and adding a date does a count (??). Other than summing up a float, which would be common for financial purposes, I'm not sure what the rhyme or reason is for the defaults on everything else. Is there definitive documentation on what the default selection is by excel or more info on how this is done?
I am using Power Query in Excel 2016 to combine data from 12 different workbooks within the same folder system into one table, and need to add an additional column in the master table that tracks the status of each row. However, when I refresh the data, the Status column does not follow the rows to which it is initially applied.
I have already looked at [ Inserting text manually in a custom column and should be visible on refresh of the report ] but this solution only works with a unique ID column. Because each of the 12 workbooks is edited separately and because there is no single column that can be guaranteed to have unique values between all of the different spreadsheets, I don't have a key to join the data to the additional column.
I believe there is always a way of finding a Unique ID. If you can get your head around this, it is not that difficult to solve your problem.
See my below example, I used three sample workbooks saved in a Test folder. Depends on the way you add them to the query editor, in my example I used From Folder and follow the prompts without making any changes and combined the tables automatically. Once combined there is a Source.Name column automatically added. I suggest to leave this column in your output table as it can form part of the Unique ID if your data is highly identical across the workbooks.
An optional step (not in my screenshot) is to add an Index column and concatenate the index number with a product/task name so it can make that specific line of data entry even more unique.
Once you added the Status column with data entered manually on the master table, load the master table back to query editor.
Then go back to the original query (Test (Input) in my example) and merge it with the reloaded output query. See my screen-shot for how to 'uniquely' merge the two tables.
The rest is self-explanatory. I think the key is finding elements of the Unique ID and incorporate it in the merge part.
Let me know if you have any questions. Cheers :)
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.