I am looking to flag all line items in "array B" where a flag is assigned if there is a partial match in "array A". I would like to make the "flag" that is returned the cell found in "array A".
I am wondering whether or not Index Matching with a Wild Card reference is the correct way to accomplish this. I am pretty new to Excel formulas.
Please see below what I have already accomplished.
I have already tried multiple equations found on Stack Overflow, but they do not seem to address my issue. Please see below for the equation that I am trying to use.
view the screenshot of my file here:
Here is the formula I am trying to use =INDEX(B$1:B$9998,MATCH("*"&G2&"*",A$1:A$9999,0))
I expected the contents of the "flag" column to return but instead, the equation returns value #N/A
EDIT: I have included a simpler data set to use as an example below
View Simpler Data Set Here - Cant Post Images Yet - Edit to include if you can, thanks!
Thanks for your additional explanation. If you want to match the Variation Sku (column G) with the Master Sku (column A), I assume that you want to use wildcards because some of your variations (e.g. BER-92-MP-002) might slightly differ from column A (e.g. "xxxBER-92-MP-002xxx"), that is why you wanted to look for:
"*"&"BER-92-MP-002"&"*"
Assuming this is correct, then you can use an Array formula to look for the Row number where the match occurs, e.g. cell E2 (Ctrl+Shift+Enter):
=MAX(IFERROR(IF(FIND(G2,$A$2:$A$9),ROW($A$2:$A$9)),0))
Then your Flag can be retrieved as follows (cell F2):
=IF(E2,INDEX($B$1:$B$9,E2))
Screenshot with the final result:
I hope it helps & apologies if I misunderstood your original request. Happy to adjust both formulas if necessary (you can post additional screenshots by editing your original post).
Adjusted:
Assuming that your search string always starts with "SKU" and is followed by "-" symbol and one additional string (e.g. SKU-BLUE), you can use the following formula in cell F2:
=IFERROR(MATCH(MID(H2,FIND("SKU-",H2),FIND("-",MID(H2,FIND("SKU-",H2),100),5)-1),$A$1:$A$5,0),0)
Formulas in column G are the same as in my previous post. Final result:
Related
I have a long list of part numbers where I need to be able to lookup and retrieve information on them.
These parts can have several alternative part numbers. I have figured out how to get the data returned if my data table only shows one of the possibly part numbers.
The issue is that I want it to be able to look up the columns to find a matching value.
As in the picture below for example. 5-E26 is the equivalent to E5-25. So if I input 5-E26 in the cell, I want it to continue searching to find the value in B7, and return the data as done A4 and A5.
Is this possible to do with Vlookup? Or is there a smarter method for it?
I struggle to fully understand how your data works but here is a possibility:
So the translated version of the formula I used in G2:
=INDEX($D$1:$D$5,AGGREGATE(15,3,((($A$2:$D$5=F2)/($A$2:$D$5=F2))*ROW($A$2:$A$5)),1))
You could also try (in my case):
=INDEX($D$1:$D$5,SUMPRODUCT(($A$2:$D$5=F2)*ROW($A$2:$D$5)))
What I am trying to do is find a formula that I have been unsuccessful in locating and alter it to what i need it for. What I have is a list where names are duplicated throughout with different values on either side of the name. I would like to be a way where specific thing happen.
I will try to explain and give an example.
In Column A I have all of the names, not in any particular order, just all jumbled. In column B I have a time or the value "off" if someone is not scheduled for that day. What I would like to do is is find each instance in which "John" is working and return the value if it does not say that he is off or vacation.
Example
The formula I have that shows every instance is here. This would reside in D2:
Code:
={IFERROR(INDEX('$B:$B,MATCH(0,IF($C$2=$A:$A,COUNTIF($D$1:D1,$B:$B),""),0)),"")}
The formula I tried but have not had any success is here:
Code:
={IFERROR(INDEX('$B:$B,MATCH(0,IF(NOT(OR("Off"=$B:$B,"Vacation"=$B:$B)),COUNTIF($D$1:D1,$B:$B),""),0)),"")}
Any help would be appreciated!
Made some changes in your formula:
=IFERROR(INDEX($B:$B,MATCH(0,IF(($C$2=$A:$A)*("Off"<>$B:$B)*("Vacation"<>$B:$B),COUNTIF($D$1:D1,$B:$B),""),0)),"")
This is an array formula so commit it by pressing Ctrl+Shift+Enter.
Referring whole column (like $A:$A or $B:$B) in array formula makes execution very slow and hence is not advisable, instead use the range with data such as
=IFERROR(INDEX($B$1:$B$9,MATCH(0,IF(($C$2=$A$1:$A$9)*("Off"<>$B$1:$B$9)*("Vacation"<>$B$1:$B$9),COUNTIF($D$1:D1,$B$1:$B$9),""),0)),"")
I found slightly different formula than what you are trying to use, but it might help you. (in the codes below "John" is in C2)
=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B:B)/((B:B<>"off")*(A:A=$C$2)),COUNTA($A$1:A1))),"")
if you want it to remove also "vacation" then
=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B:B)/((B:B<>"off")*(B:B<>"vacation")*(A:A=$C$2)),COUNTA($A$1:A1))),"")
in my localization I am using ";" instead of your "," (I already changed that in the examples) so there might be some other minor changes you need to apply to the code... btw you dont need to enter this as array formula.
I need to search in a column for the word "complete" and if it doesn't exist then I need to subtract a date in another column from today (TODAY()). I have several fields that do not have any values so I'm also doing a check for NULL fields. This is my formula:
IF(AND(SEARCH(M30,"complete"),O30<>""),"*",O30-TODAY())
(Column M is string of text and column O is a date.)
When I run this formula I'm getting a #VALUE error so I assume something needs to be typecast.
I don't think it will matter for this particular question but I'm using Excel 2013.
When the search term is not found the formula will produce an error. So you have to check for an instance of an error to see if it's found or not.
This formula should work:
=IF(AND(NOT(ISERROR(SEARCH(M30,"complete"))),O30<>""),"*",O30-TODAY())
N.B. - Bear in mind that the Search function as you wrote it may actually be reversed. Depending on your needs, you may need to write it as SEARCH("complete",M30)
I am using the following formula to grab a number from each PivotTable and sum the result.
=SUM(Index(A1,Match(D1,G1:G50,0)),(Index(W1,Match(Y1,Z1:Z50,0))
The formula is then copied down to match the name in A1 down to A100. The problem is that in some cases there is a match for the name for only one of the two PivotTables, and the result isn't calculated. In cases where the name is found in both PivotTables, it calculates without a problem.
How do I specify that if there is no match it should just treat it as a zero and continue on?
The question is answered through comments, hence porting the answer here behalf of Demetri
Note: Additionally added cell freeze option in formula by using "$"
Use the below function to worn on it.
=SUM(IFERROR(Index($A1,Match(D$1,$G$1:$G$50,0)),0),IFERROR(Index($W1,Match(Y$1,$Z$1:$Z$50,0)),0))
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!!