I'm comparing two columns matching a cell value in "P26" and if i find a match, output that value in the second column to the current cell i have this formula in. This formula works, I was wondering if there is a way to find a wildcard match from my value P26 lets say "1234*" instead of just a exact match "1234" ? Something like match "like" P26?
columns look like this, P26= "3 OK" <--- the "OK" is the wildcard part. i need to match the "3" in column 1 then output column 2 to the cell value.
1 12345
2 64578
3 56465
This formula is in a cell value:
=IFERROR(INDEX(AF4:AF31,MATCH(P26,AE4:AE31,0)),"---")
Use an Array formula like this:
=INDEX(B1:B5,MATCH(TRUE,ISNUMBER(SEARCH(A1:A5,D1)),0))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.
Related
I have a question regarding the closest match when using index/match formula.
I use CONCAT to make a new field out of 3 cells. In the last cell I have a number, varying from 0 to 10.
So I get fields like ABCCBD3,ABCCBD5, ABCCBD7, ABCCBD10 etc.
I need to find closes matches for 5 and 10 in the end.
For example, if my INDEX/MATCH lookup finds ABCCBD6 (any number above 5 in the end) it should identify it as ABCCB10. If it finds from ABCCBD to ABCCBD5 it should identify it as ABCCBD5.
Because in my lookup I need to fill columns either "5" or "10". So any result from ABCCBD to ABCCBD5 will go to column named "5" while any result from ABCCBD6 to ABCCBD10 will go to "10" column. Is this something doable?
Here's an example:
For example:
Formula in G4, if one has O365:
=LET(X,FILTER($D4:$E9,CEILING($D4:$D9,5)=G3),INDEX(X,0,1)&INDEX(X,0,2))
Drag right.
With earlier versions of Excel, try:
=IFERROR(INDEX($D$1:$D$9,SMALL(IF(CEILING($D$4:$D$9,5)=G$3,ROW(D$4:D$9),""),ROW(A1)))&INDEX($E$1:$E$9,SMALL(IF(CEILING($D$4:$D$9,5)=G$3,ROW(D$4:D$9),""),ROW(A1))),"")
It's an CSE-entered formula. Drag right and down.
On tab 1, I have data down column B that contains string values like this:
\\ABC\VOL1\DATA\Dan\Personal Folders
\\ABC\VOL1\DATA\Mike\My Stuff\Docs\Support
\\ABC\VOL1\DATA\Mike\My Stuff\Photos
\\ABC\VOL1\DATA\Bob\Plans
On tab 2, I have data down column C that I want to use as a lookup table like this:
\\ABC\VOL1\DATA\Adam
\\ABC\VOL1\DATA\Steve
\\ABC\VOL1\DATA\Mike
\\ABC\VOL1\DATA\Ronnie
I need a formula I can put on tab 1 down column C to see if any part of each text string from tab 1, column B matches any complete text string from tab 2, column C. So for example, I would place this formula to show Yes or No like this:
Column B......................................................................Column C
\\ABC\VOL1\DATA\Dan\Personal Folders....................No
\\ABC\VOL1\DATA\Mike\My Stuff\Docs\Support..........Yes
\\ABC\VOL1\DATA\Mike\My Stuff\Photos.....................Yes
\\ABC\VOL1\DATA\Bob\Plans.......................................No
I have tried VLOOKUP, INDEX/MATCH, ISNUMBER/SEARCH, and COUNTIF as an array with wildcards, but I just cannot seem to figure it out. Currently, with COUNTIF as array, I have this:
=COUNTIF(B2,"*" & 'Tab 2'!$C$2:$C$1000 & "*")
This is the start to return the array results, but the results aren't as I would expect as I get "0" when I should get "1" for certain rows.
If anyone can help me out with a formula (not VBA) using any of the functions mentioned above or any others, I would greatly appreciate it. Thanks.
use this array formula:
=IF(COUNT(SEARCH('Tab 2'!$C$2:INDEX('Tab 2'!$C:$C,MATCH("zzz",'Tab 2'!$C:$C)),B2)),"Yes","No")
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
This will search the cell for any of your criteria and return the number of matches if there is a match (which unless you have duplicates in the criteria it will be a 1).
Enter as array.
{=COUNT(SEARCH($C$1:$C$4,B1))}
Do you know any way to write a formula for vlookup/indexmatch which will look for first result other than "null" for "aaaa", and then for bbb etc?
I was trying to do that with using multiple if/offsets etc, but its not working.
Is it even possible (there can be one row with "aaa" but also 10 on even more).
The following array formula returns the first entry in column B where it is not null and also where column A has cell value aaaaa.
= IFERROR(INDEX(B1:B6,MATCH(1,(A1:A6="aaaaa")*(B1:B6<>"null"),0)),"no match")
Note this is an array formula, so you must press Ctrl+Shift+Enter on the keyboard after typing the formula rather than just pressing Enter.
To return a similar result except for bbbbb, just replace aaaaa in the above formula with bbbbb.
I'd like to search an element in a column and then use this element in a vlookup formula. My column contains either the same number (i.e : 2300) or nothing (""), but I have 26 different possible number (each number = a company).
I'd like to avoid VBA if possible
Example:
File 1.xlsx, COL A:
""
"2300"
"2300"
""
"2300"
"2300"
...
File 2.xlsx, COL A:
""
"1200"
""
"1200"
"1200"
"1200"
...
So if I'm the File 1.xlsx, I'd like to do the following : "If find something different than "", then print the number".
Hope I'm being clear. Thanks for your help in advance!
Jean
You can't use a vlookup on this kind of data. The value you're looking for must be in column sorted in alphabetical order, then from that, you can retrieve the value present in a cell present on the same line.
If you only want to test if the cell in empty, you could do simply this
=IF(<your cell>="";<you other cell>;"")
Be careful of relative and absolute coordinates.
This formula will return the first non-blank value that doesn't match 2300 in the range A1:A10. Update the range (in all 3 places) as required, and replace 2300 when searching for different values.
=INDEX($A$1:$A$10,MATCH(1,($A$1:$A$10<>"")*($A$1:$A$10<>2300),0))
Note this is an array entered formula. To enter it correctly, you need to double click into a cell so that you're in edit mode, paste the formula then confirm it by pressing CTRL+SHIFT+ENTER
In B2 I have text to search within, in C2 I have this formula to search for words on a worksheet called "keywords" to match against.
{=
IF(B2="","",
IF(ISNUMBER(SEARCH(keywords!$B$2:$B$5,B2)),"Fruit",
IF(ISNUMBER(SEARCH(keywords!$C$2:$C$5,B2)),"Nature",
IF(ISNUMBER(SEARCH(keywords!$D$2:$D$5,B2)),"Vehicle",
"no match"))))
The formula is only using the first keyword in B2, C2, D2 on the keywords worksheet, and not through B5, C5, D5. What is the correct formula?
I understand the result will be the last satisfied statement if more than one match is found. Please help!
formula
keywords
For a non CSE array use sumproduct:
=
IF(B2="","",
IF(SUMPRODUCT(ISNUMBER(SEARCH(keywords!B$2:B$5,$B2))*1)>0,"Fruit",
IF(SUMPRODUCT(ISNUMBER(SEARCH(keywords!C$2:C$5,$B2))*1)>0,"Nature",
IF(SUMPRODUCT(ISNUMBER(SEARCH(keywords!D$2:D$5,$B2))*1)>0,"Vehicle",
"no match"))))
For a slightly shorter formula that uses the title row on the keywords sheet as the return value, so no need to hard code the values. Use this:
=INDEX(keywords!$B$1:$D$1,AGGREGATE(15,6,(COLUMN(keywords!$B$2:$D$5)-COLUMN(keywords!$B$2)+1)/(ISNUMBER(SEARCH(keywords!$B$2:$D$5,B2))),1))
The ranges can be expanded to allow for more rows or columns in the future, without the need of adding more IF statements.
Try:
{ =
IF(B2="","",
IF(MAX(IFERROR(SEARCH(keywords!$B$2:$B$5,B2),0))>0,"Fruit",
IF(MAX(IFERROR(SEARCH(keywords!$C$2:$C$5,B2),0))>0,"Nature",
IF(MAX(IFERROR(SEARCH(keywords!$D$2:$D$5,B2),0))>0,"Vehicle",
"no match")))) }
The issue is that the search within your formula is looking a for a single value to search for within a specified text string therefore when you select the range $B$2:$B$5 it selects the value in the first cell of the range of cells.
Rather then using the SEARCH function use MATCH function with a Match Type of 0 for and exact match. NOTE: this does not need to be an array formula.
Example:
=IF(B2="","",IF(ISNUMBER(MATCH(B2,keywords!$B$2:$B$5,0)),"Fruit",IF(ISNUMBER(MATCH(B2,keywords!$C$2:$C$5,0)),"Nature",IF(ISNUMBER(MATCH(B2,keywords!$D$2:$D$5,0)),"Vehicle","no match"))))
Also your statement "I understand the result will be the last satisfied statement if more than one match is found. Please help!" you may have meant the first satisfied not the last; which would be correct.