I have two columns of words (Old list) and (New list)
I'm trying to check using the VLOOKUP() function both columns and find which words of the New list doesn't appear in the Old list.
(The answers here is obviously: eyes, john, martha, phone)
I'm giving this simple example to know what VLOOKUP() formula to also apply to a larger sample. In reality I have two columns of over 1000 items. Thanks
=FILTER(F2:F10, ISNA(VLOOKUP(F2:F10,A2:A10,1,FALSE)))
This will filter it down and remove all the N/A values while comparing the 2nd list to the first.
EDIT:
as per comment needing clarification (too long to put as a comment)
You can do anything you’d like by substituting references. It’s best to think of the syntax of things here to get a lay of the land and figure out what you want to pull information from.
The ISNA() just handles N/A errors that will occur with partial lists and is irrelevant to understanding where to put your references.
=filter(array, include, [if_empty])
Where “array” is the range you want to filter FROM
And “include” is what you are searching FOR from that range.
The [if_empty] is optional – you can put a text there, like “No Results” in quotes so that it’ll substitute that for N/A.
The “include” portion is where I’ve added additional information because I want to narrow in what I’m including…. In the plain and simple form of =filter() you’d just be putting a word/cell reference you’re looking for. It’ll pull every column for the whole table if there are multiple columns. But we want it to search multiple criteria simultaneously.
=vlookup(lookup_value, table_array, col_index_num,range_lookup)
what you are searching FOR (in this case anything within the table), where you want to look for it (where you are searching FROM), which column to find it in (column 1 in your case), and TRUE/FALSE – exact or approximate matches.
The easiest way to search across multiple sheets is to have the files open, and as you type in the formula bar when you get to each section click and highlight what you want by switching sheets (alt tab). Just pay really close attention to searching FOR versus searching FROM and you can do any combination of comparison you need.
If you would like TRUE/FALSE for each element you can use the following
=ISNUMBER(MATCH(A1,ColumnToSearch,0))
Related
I need to count how many cells in a table column that contains a specific text string. I'm using this formula and it works well:
=COUNT.IF(TB_table_name[col_name];"*string_to_be_found*")
But I need to count only filtered cells.
I've found may solutions (using SUMPRODUCT) on internet, but only to common cells and not table conlumns.
This is the kind of table that I have:
As you can see, there are many values in the same cell (It happens because it is generated automatically by a survey made in MS Forms). Because of this, I need to search for a specific string to be counted.
Using "COUNT.IF" I have this results:
Please observe that the values in the cell are not random, but predefined - of course the sequence could not be the same, but the list of possible terms are.
Please, can you help me figure this out? Belive me, I have tried many things but nothing worked and it seems to be a thing so easy to achieve :(
The trick is to combine a couple of the ideas you found using SUMPRODUCT.
You likely found this reference (or one just like it) that gave guidance for a formula like this:
=SUMPRODUCT(SUBTOTAL(3,OFFSET(B2:B7,ROW(B2:B7)-MIN(ROW(B2:B7)),,1))*(B2:B7="Quality"))
Which translates to your problem-space like this:
=SUMPRODUCT(SUBTOTAL(3,OFFSET(TB_table_name[col_name],ROW(TB_table_name[col_name])-MIN(ROW(TB_table_name[col_name])),,1))*(TB_table_name[col_name]="*string_to_be_found*"))
This works perfectly fine if you're NOT using a wildcard search. But that's what you need. So in this answer it shows that the wildcard in a SUMPRODUCT needs to use the -- operator. So the result is to combine the two answers and you get:
=SUMPRODUCT(SUBTOTAL(3,OFFSET(TB_table_name[col_name],ROW(TB_table_name[col_name])-MIN(ROW(TB_table_name[col_name])),,1))*(--(ISNUMBER(FIND("string_to_be_found",TB_table_name[col_name])))))
Notice that the string_to_be_found does NOT have wildcard * specifiers. That's taken care of by the FIND function.
I've made a list of bars for my friends/coworkers and I want to add a tool that allows them to search for bars that match their preferred criteria.
The google sheet can be found here.
I want the user to be able to search based on the criteria they input on the left under "keywords". So this many be anywhere from 1, keyword to all 7 filled out. But I want it to search based on any combination.
I initially started with an INDEX/MATCH formula which only returned a single row.
I landed on the FILTER function after trying different options.
However, this does not ignore blank search terms. Cell D4 on the Search page has the current formula. This will filter by Area, and then Area and Category if both are filled out, but I have yet to figure out how to expand this to the remaining filters.
My current function is the following:
=IFERROR(IF(AND(LEN(B6),LEN(B7)),FILTER(AllInfo,Area=B6,Category=B7),FILTER(AllInfo,Area=B6)),"-")
The filter function does exactly what I want for one search criteria, but my attempts to include any combination of search terms have failed.
I have a number of named data ranges which reference their respective columns on the 'Toronto - BARS' sheet.
Feel free to share this list with any friends living in Toronto!
Edit: removed irrelevant information
The closest I got is the formula below, which requires you to replace the boolean values into "yes" and "no" (or any other string values):
=ArrayFormula(query({AllInfo},"select * "&if(counta(B6:B12)>0,"where ",)&join(" and ","Col"&(match(filter(A6:A12,B6:B12<>""), transpose('Toronto - BARS'!A1:I1),0))&"='"&filter(B6:B12, B6:B12<>"")&"'"),0))
2 improvements that could be made, but I didn't figure it out:
using the column names in the query, instead of column number
parsing the boolean values correctly and add or remove the single quotes accordingly, so it can support the current boolean values / checkboxes
==> I hope someone can pick that up and finish what I couldn't get done.
"I'm setting up a pivot in excel, and want to extract specific words from a data set of text.
I have tried using the below formula to extract one particular word, but want to nest the multiple formula to extract other words as well
=TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",99)),MAX(1,FIND("Evaluation",SUBSTITUTE(A1," ",REPT(" ",99)))-50),99))
The above formula works but only for one word. I want to create nested formula to search first word or second word or third...
If your goal is to search an array for a a substring, if that substring matches any words in a list, and if so, return the matched substring, as in the post suggested by JvdV, use the formula below, which I have modified.
I recommend, in a different worksheet, add a table with a list of the words you want to find, like this. Highlight the range of cells, including the header, then Home > Format as Table > pick a table style and give it a name. This table's name is "t_WordsToFind" (so I can easily identify it in other functions later). You may want to also put your primary data into a table as well. My go-to name is usually "t_Data". Now, instead of worrying about column numbers/letters, you have the user-friendly column headers you started with which makes reading the formula much easier. Your table ranges will also automatically expand when addtl data is added, so row numbers don't need to be referenced any more either.
If you don't have your data in tables, use this version of the formula, and remember to update your range parameters when data is added. B2 is the first cell to be searched, D2:D4 is the list of words to look for, copy the formula down. I do prefer not to use IFERROR as it includes many different types of errors that I may need to know about, like if I misspelled the function name, for example. If you simply need to have an alternative in the event no matches are return and your function is valid, I recommend IFNA.
IFNA(LOOKUP(1,1/COUNTIF(B2,"*"&$D$2:$D$4&"*"),$D$2:$D$4),"")
If you do use tables for your data and lookup tables (you are very wise) and here is the formula version to use (below). In this example, #[Search This Column] is the the equivalent to B2 and t_WordsToFind[Find This] is the table name and column name of words to look for, but it's much more legible, and doesn't need to be copied down or manually expanded in the future.
IFNA(LOOKUP(1,1/COUNTIF([#[Search This Column]],"*"&t_WordsToFind[Find This]&"*"),t_WordsToFind[Find This]),"")
Even wiser still, assuming this is a perpetual need, would be to use power query/power pivot, but I don't want you to go into TMI overload.
Also, your pivot table range will be nice and easy, "t_Data".
the following problem: I have an array of tables of witch I want to get a sum range of matching values. Here is the sheet:
Tables
The matching values do not have to be exact matches. For example, for 28car.com I am interested in 28car, car28 or 28 car, so values which closely resemble the website keyword. This is because these keywords are based on queries from search keywords of the respective websites and may be prone to change.
SUMIFS would therefore not work as I can only find exact matches (and these keywords may change on a monthly basis). I thought about VLOOKUP or INDEX & MATCH, but I don't know how to possibly execute either two.
Any suggestions?
https://imgur.com/a/OtzkE
well you can use VLOOKUP with true as the last parameter i think, that will give you a non-exact matching word.
Alternatively you could add another table whith all the options for the KEY you would like to find.
Maybe if you give a little more information or some sort of image, we can help you better.
I'm trying to tweak this piece of code I found in a sample spreadsheet online but I can't quite get my head around it.
The original spreadsheet basically does an INDEX/MATCH based on a user-defined lookup and lists the matches neatly in a concatenated list. The sample spreadsheet's output looks like this:
http://i.stack.imgur.com/DyahB.png - Sample Excel Output (Note how there are no gaps between the first and second matches)
The underlying algorithm is:
=IF(ISERROR(INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$E$1,ROW($A$1:$A$8)),ROW(1:1)),2)),"",INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$E$1,ROW($A$1:$A$8)),ROW(1:1)),2))
Now, I want the lookup to instead retrieve PARTIAL matches, and in addition, generate the outputs horizontally like so:
http://i.stack.imgur.com/ShED0.png - Output is generated horizontally based on partial matches
I'm not sure how I would go about doing this. It seems like I would somehow try and change the IF condition to return true on partial matches but I can't get my head around it. Please help!
Assuming by "partial match" you mean text that starts with the value in L1 then use this formula in N1
=IFERROR(INDEX($I$2:$I$8,SMALL(IF(LEFT($H$2:$H$8,LEN($L$1))=$L$1,ROW($I$2:$I$8)-ROW($I$2)+1),COLUMNS($N1:N1))),"")
confirm with CTRL+SHIFT+ENTER
and copy across
For a match anywhere in the text you can use this version
=IFERROR(INDEX($I$2:$I$8,SMALL(IF(ISNUMBER(SEARCH($L$1,$H$2:$H$8)),ROW($I$2:$I$8)-ROW($I$2)+1),COLUMNS($N1:N1))),"")
Neither formula is case-sensitive, although you can easily make the latter so by changing SEARCH to FIND
Use of IFERROR function means you don't need repetition for error handling - needs Excel 2007 or later version
Building on Barry's code a little, I needed to make a few tweaks for my own use (current project I have at work).
Tweaks I made:
Returning the cell that matches my search criteria in my index
Making the cell draggable in two dimensions so I could index multiple columns for specific information
Making the "nth" counter vertical instead of horizontal (as my application is a database of sorts, and each column is a separate entry. At the top of each column is 5 rows populated based on the search term [in my case, the store number])
The final result is:
=IFERROR(INDEX(A$8:A$295,SMALL(IF(ISNUMBER(SEARCH('Store History'!$F$2,A$8:A$295)),ROW(A$8:A$295)-ROW(A$8)+1),ROWS(A$2:A2))),"")
It is worth repeating that this is an array formula and needs to be entered using CTRL+SHIFT+ENTER
This is placed in cell A2 and is dragged both vertically and horizontally (horizontally in my case is ever expanding as I add more entries into my database).
My purpose for adding this comment (even though it is a long inactive thread) is to try and make this a more relevant search result on Google for "excel index match partial strings with multiple results" or variations of that. It took me hours of searching to find this solution, and it is extremely functional and elegant. My thanks to the OP and especially to Barry for his code!!