Excel Match Index for Mutliple Criteria in one cell - excel

I have a spreadsheet which is filled automatically from data in Microsoft Sharepoint. Unfortunately this data fills my location column as follows: IND;# ENG ;# USA if for example that particular input has 3 locations.
I then have drop down boxes (made via data validation) to filter the results down and give an optimum result. However when it comes to choosing location i can either choose ALL, IND, ENG, USA OR IND;# ENG ;# USA. If I chose, for instance, IND, then the options that are in multiple locations will not be returned (only the options that are in only IND will).
I was just wondering if there is any way, avoiding VBA, which will enable a choice of the individual location to return all options in this location, including the options that are availible in multiple locations.
** Please note that these multiple locations are contained within the SAME cell.

It's not possible as you have the question written. A drop down list created by data validation can only display a single result. If you chose 'IND' and wanted to show results for say 'IND' and 'IND, ENG' you would need to use something other than a drop down list or you need to do additional filtering based on the value selected down stream in your code/logic.
I'd say your best bet is to use VBA. This can be transparent from the user. When a user selects a value in the drop down list, vba can sort and filter the remaining drop down list based on what was selected (aka dependent drop downs)

Related

Excel - Restrict Options in Drop Down Fields to those currently not in use

I restrict the options (an ID) for column A:A to those given in a drop down menu.
The possible elements are in K1:K10. In L1:L10 there is a flag (0/1) whether the ID is currently already in use or not.
Now I want to restrict the options in the drop down menu to those from K1:K10 which are flagged as 0 in L1:L10. Those flags can change multiple over the life sycle of that document. While in use, I don't want that ID to be selectable. Ones no longer flagged as in use, I want it to become available again.
Depending on your Excel version this may be a solution, as Validation Lists can refer to dynamic arrays.
Use the FILTER function to create a dynamic array of valid names in cell M1.
=FILTER(K1:K10,NOT(L1:L10))
Then set the Validation List to =$M1$#. NB the # is important as it tells Excel you are using a dynamic range rather than a standard cell reference.
and now (if you have Calculation set to Automatic) you should see the list of available names change as you change 1's and 0's in Column L.

Allow exception for dependent (secondary) data validation

I am trying to make a form that will give users a list of possible defects to choose from when reporting a customer complaint. First they will choose from a list of regions on the product where the problem exists and then they will choose from a list of possible defects which will populate based on the location selected in the first list. I have made the list of regions as comprehensive as possible but I feel that it is likely that something will arise where I have not forseen this issue as a possibility. As such I would like to include an "Other" option in the location drop down list which, when selected, would change the second data entry point from a data validation list to allowing the user to typ anything the user would like to add. Is this possible to have the type of data validation dependent on a condition?
Dependent dropdown lists validation. Reference youtube video one and two
You can mention "Others" option on the top of the source list for the first (Location) validation. You can then add data validation for the first list using named range with offset function. This will allow you to freely add other locations at the bottom of the list.
For the second column validation, you can enter formula skipping the first ("Others") cell in the location list.
In the image below, validation source list for column D is $A$2:$A$10 and validation list formula for Column E is =IF(COUNTIF($A$3:$A$10,$D2)>0,$B$2:$B$10,$E2)

Create relationship between two lookup columns in a sharepoint list

I have a Sharepoint List 'TeamValues' that defines values that should appear in another list.
TeamValues List:
Title Team Sub-Team
1 A Blue
2 A Green
3 B Yellow
4 C Silver
5 C Gold
I have a list that users can edit and in this list I want to lookup 'TeamValues' list and create a dropdown list for users to select a value from the Team column. This needs to be unique so in this case the values that should appear are: A,B,C
Once they select a value I need a second column to populate a drop down list that users can select E.g. If they select Team: A, then the second drop down should show: Blue, Green as the options.
How can I do this using Sharepoint? I don't have any code access and only have the sharepoint GUI to work with.
Is this possible?
I have created a lookup choice column Team that looks at my TeamValues List however this is showing all values e.g. A,A,B,C,C. I have created a lookup choice column for the subteam that also shows every value. I dont know how to link these together or get a relationship between the two choice drop downs/ remove duplicate values. I tried the following option: 'the Enforce unique values is not displayed.' which did not work
No code applicable
I am sorry to say that but I think there is no OOB functionality to show distinct values of lookup column and to do this kind of relation without any code. I also did some research just to be sure but I could not find anything like that.
If You would consider some code You can always use javascript jsLink technology to achieve this. It's not that hard. It's a JS file that You can add to some lib on sharepoint site and then You can add this JS to webpart manually without any deploy or other. After that with javascript You can overwrite the default behavior of any control/column and do this kind of relation or show only distinct values.

Search formula for best text match among two excel lists

I have a long list of products (+20,000 items) of surgical instruments. Sometimes I receive requests for different names of these products which is impossible to manually match in my list.
I was thinking of a formula to find or suggest the closest result of match for the common words in each cell.
I have created this formula:
=INDEX('Products'!G:G,MATCH((("*"&LEFT(A2,5),'Products'!G:G,0))
(where Products G:G refers to my long list.
it gave some results correctly but more than 80% of the result came back with false results.
please see the attached image to show you the result.
is there is a way I can get more accurate result?
or I was thinking of finding major category of each item such as:
Category 1: Scissors, Retractors, Knives, etc.
Category 2: Straight, Curved, Angeled, etc.
Category 3: Sharp, Blunt, etc.
Category 4: 10mm, 130mm, 24cm, etc. (size)
which is easy for me to do it.
then use the same formula but with referring to the common words..
something like:
=INDEX(Products!G:G,MATCH("*"&LEFT(E2,5)&"*"&F2&"*"&G2&"*",Products!G:G,0))
where E2, F2, G2 refers to the categories..
I tried but it gave false results as well.
I urge you in the strongest sense of the word to spend some time creating a good quality master table and then spinning off 1 table for each category.
make use of clean(), trim(), proper(), heck, if you need to copy the data in notepad++ and enable view all symbols then switch between ansi utf utf8 wtf omgwtf or any other encoding to ensure you dont have any hidden special characters than do it.
you have 4 categories, so that's 4 1 column tables. name them. no duplicates. no trash. no junk. sort your data. nice clean names/words/whatever you categorize by. if you absolutely must add an index or key column then go ahead but do yourself a favor and stop there. use a different table to deepen your relationships.
next step is to to create comboboxes. i'm not sure why but the combobox in excel is not the same combobox in the vba editor. you want the one in the editor. you can make a fancy user form or you can make a minimalist text box design. whatever you fancy. just make sure the combobox has a field for RowSource in the properties. for whatever reason i don't get that option if i am not in the vba editor when i create the box.
you're almost gauratneed to want drawmodal = false on every user form you make for these boxes
you probably really don't need more than 4 boxes but it depends what you're doing so that's up to you. name your combo boxes.
verify each box has: matchentry = 1-fmMatchEntryComplete
i recommend: style = 0 - fmStyleDropDownCombo
this will allow you to begin typing and autocomplete the first match and also let you select from a drop down list, starting with the the first match of the name you've typed.
you can set the number of elements in the list. default is 8. if you have a slow computer than i wouldn't push it much. if you have a best then give it a shot.
you can also change fonts for easier reading and a bunch of other format changes.
now the this is the most important part - RowSource will be one of those 4 tables
now that i've given instructions, let me explain why. some businesses don't have the best practices and i'm currently with one that's using an oracle erp solution for data management but the front end isn't used. data entry is done in excel and loaded into oracle using batches. lookups in oracle continue to be a psychological barrier for the ap/ar teams so i did exactly what i suggested here but took it a few steps farther.
i pulled the vendor master and i pulled teh customer master
i cleaned the data and compiles simple pure clean 1 column tables
then i created a form for the comboboxes
first came ap with vendor name
then vendor number
then vendor remittance location
our orderering facility number
selecting a vendor name populates the vendor number box with the possible vendor numbers. same for remittance location and ordering facility
i pulled a year's worth of transaction data and created a gl table. some vendors have only ever used 1 gl acount. some several. there's a % number next to each gl. that represents the value of transactions posted from that vendor to that gl for the last year.
next up a date picker and text boxes for invoice fields.
get it nice and tight on a form, set the tab stops, add a commit button and all of a sudden we have a front end excel platform that performs better than oracle - because people use
i haven't finished the ar side but it'll get done and i'll the angels will be rejoicing and singing my name for years to come.
1:1 matching with autofill and drop down functionality you can't beat it. that's what you get with my suggestion.
best of luck!

how to autocomplete values based on a list

I created many Lists and they are getting longer. At the moment i am using data validation, so I have big lists and need to select the name i want
They are all listed on my formulas, so i would like to know if there is any way
to start to write the name that i need and excel already shows the
possibilities...
I tried to use this formula but was not successful
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$300,-1),1)
For instance i have a list of currencies called "CCY", i would like to write
"US" and excel already shows USD. Is there any way to do that?
=OFFSET(Currency,MATCH(A2&"*",Currency,0)-1,0) 'A2 is where the validation applies, make sure it accepts values not in list
You can enter the value in a second go, will let you select from values after.
I wouldn't use it but
It will let you select any value from the drop-down
You can let it do its job by typing "us", Tab, Shift+Tab, Alt+Down and Tab quite fast.
The formula below won't let you select values after, takes the first match only, handle with care.
=OFFSET(Currency,MATCH(A2&"*",Currency,0)-1,0,1,1) 'fun fact: you can give names to data table columns thus creating expanding lists

Resources