I have in my Excel workbook two tables:
In first table I have string text full sentence (in colunmn C) in many rows where is described in sentence some place names (some rows don't have those location names) and
in second table I have place names list (every place name have also geographical X (latitude) and Y (longitud) coordinates.
I want to search inside first table string text location names which have exact match to the placename_table list and show founded place name in first tabele column D. I tried this formula in column D, it almost working, but it finds first match of placename_tabele and it is not correct what was mean in first table string.
I use Excel 2013
=IFERROR(INDEX(Placename_table; SMALL(IF(COUNTIF($C2;"*"&Placename_table&"*"); MATCH(ROW(ANIMI); ROW(Placename_table)); ""); COLUMNS($A$1:A1))); "-")
placename_tabels
You may try FILTERXML() with index. Put below formula in D2 cell then drag down and right.
=IFERROR(INDEX(FILTERXML("<t><s>"&SUBSTITUTE($C2," ","</s><s>")&"</s></t>","//s[starts-with(., 'placement')]"),COLUMN(A$1)),"")
Related
Name Day 1 Day2 Day 3
John 3 2
John 2 1 4
Using a double Xlookup, when I'm searching for John and Day 2, I cannot get the value 1 and I'm trying Index/Xmatch/xmatch to return me 1 but no luck. Any idea to go about it?
###Updated example picture here###
enter image description here
This is my current formula
=XLOOKUP("John",$A$2:$A$3,XLOOKUP("Day 2",$B$1:$D$1,$B$2:$D$3),,2)
Note that your comments show a different case (wildcard search in names) than your question.
The following formula will result in the first found value of the wildcard search for names starting with the search string in F2 and matching the date in F3:
=LET(range,A1:D3,
c,1-COLUMNS(range),
r,1-ROWS(range),
days,TAKE(range,1,c),
names,TAKE(range,r,1),
data,TAKE(range,r,c),
x,FILTER(data,days=F3),
TAKE(
FILTER(x,
(ISNUMBER(XMATCH(F2&"*",names,2)))*
(x<>"")),
1))
You cannot use XLOOKUP two-way exact match, because it returns the first match and you have duplicated values in column Name.
This solution returns the first non blank value from the input data based on the lookup values. In cell H2 put the following formula:
=LET(colIdx, XMATCH(G3,A1:D1), tb, A2:D5, lkCol, INDEX(tb,, colIdx),
INDEX(TAKE(FILTER(tb, (A2:A5=G2) * (lkCol<>0), "Not Found"),1),colidx)
)
and here is the output:
We use LET for easier reading and composition. First we need to identify the column of our interest. The name colIdx, has the column index. Notice in order to deal with only one data range (tb), I search in all column names including Name. Now we need to identify the corresponding column values. The name lkCol represents that.
Now we have all the elements we need to filter and select the information we are looking for:
FILTER(tb, (A2:A5=G2) * (lkCol<>0), "Not Found")
The output will be the rows from tb for name G2 and filtered for non empty rows from G3 column name. The output has all the columns, now we need to select the column of our interest and only the first non empty value. TAKE extracts only the first row and INDEX the corresponding column.
I have a spreadsheet which contains addresses. The City is shown in uppercase, however, the city could be present on any of the 5 columns. I am wanting to create a formula which will search the 5 columns in the row and return the City, where the whole word in in uppercase.
I have searched this site and others and I can only fnd code which will split out words that start with uppercase.
Given that the city name will be the only word in uppercase in the 5-column range, you can use either of the following formulas to find the city name:
=INDEX(AV2:AZ2,SUMPRODUCT(EXACT(UPPER(AV2:AZ2),AV2:AZ2)*NOT(ISBLANK(AV2:AZ2))*COLUMN(AV2:AZ2)))
or
=INDEX(AV2:AZ2,AGGREGATE(15,7,COLUMN(AV2:AZ2)/(EXACT(UPPER(AV2:AZ2),AV2:AZ2)*NOT(ISBLANK(AV2:AZ2))),1))
Replace AV2:AZ2 with the first row of your actual data, and drag the formula down to apply across board.
The logic is to:
use UPPER function to convert all text strings in the 5-column range to uppercase, and compare the converted string with the original one using EXACT, the only match would be city name;
use either AGGREGATE or SUMPRODUCT to find out the column number (between 1 to 5) where the city name locates, with the help of using NOT+ISBLANK to eliminate the impact of blank cells;
use the location number in an INDEX formula to return the actual city name.
See below screen-shot for more clarifications.
Although both of them are array formulas, there is no need to press Ctrl+Shift+Enter when using SUMPRODUCT or AGGREGATE in this case.
Cheers :)
I have two columns in excel which I am trying to compare with one another and result the common element in third column. For example my sheet looks like
How do I compare Column D with E and if there is a matching string it will be printed in column F.
Edit 1: What function should I use to compare both case sensitive and non-sensitive strings.
This is kind of crude, but will tell you if the word in the first cell is in the 2nd, you can vary the left with mid, or right depending on your values.
=FIND(LEFT(C199,FIND(" ",C199,1)),O199,1)
In cell F1 place this formula:
=IF(ISERROR(MATCH(D1,$E$1:$E$100,0)),"",D1)
Then copy it down. This will show all non-case sensitive matches (for a column two list that has 100 values. Change the 100 to however long your column two list really is.)
To do the case-sensitive comparison try this:
=IF(EXACT(D1,LOOKUP(D1,$E$1:$E$100)),D1,"")
I have a large excel file, it has 65,000 parts, those part numbers are in column A. Then it has several columns of important info next to the part number (B is retail price, C is my cost, D is the weight, E description and so on until J)
I was just given a list of 16,000 new parts, they are superceeded from old parts, all the new list tells is new part number in column A and old in column B.
So what I can't figure out is how to tell excel if B65001 matches anything in column A1-A65000 then copy the information from the columns next to that A cell into the columns next to this duplicate.
I hope that makes sense?
Please help
I would:
Put the list of new parts in a new sheet (let's call this "Sheet2")
Sort this by column A (required for the VLOOKUP function)
Insert a column next to A in the original sheet
Put the formula =ISERROR(VLOOKUP($A2, Sheet2!$A:$B, 2, FALSE), $A2, VLOOKUP($A2, Sheet2!$A:$B, 2, FALSE)) in column B2 of the original sheet (the new column, and I'm assuming you have headers), and fill it down
Copy this new column and paste it over itself, but select Paste Values from the Ctrl paste options menu. This will get rid of the formula and solidify the new part number as text.
Delete the old A column and the new B column will take its place.
Delete Sheet2 if desired.
The formula in layman's terms: Excel will search for the old part number in Sheet2. If not found, it will produce an error, and just use the old number. If found, it will use the value next to the old part number on Sheet2, the new part number.
An explanation of the VLOOKUP function:
The first argument is the value to search for. In this case the value in the A column of the same row (fill-down will automatically change the "2" accordingly)
The second argument is the range to search in. Excel will look in the first column of this range for the value, and it MUST be sorted.
The third argument is the 1-based index of the column to return. In this case, you want the second column.
The final argument determines whether to return the nearest match (TRUE) or only exact matches (FALSE). You want the latter behavior.
VLOOKUP in this mode will produce an error when a match is not found (specifically #VALUE when the value would come before the first instance of the table, or #N/A if the value is not found in exact-match mode)
Copy the Column in other sheet into you want to search Duplicates,, & write this simple formula but break the database in parts to avoid system delay,,
=IF(COUNTIF($A$2:$A$8, $A2)>1, "Duplicate", "")
Use this array formula to count Duplicates,
=ROWS($A$2:$A$8)-SUM(IF( COUNTIF($A$2:$A$8,$A$2:$A$8)=1,1,0))
Ok so,
In column A basically every cell has a different composition and doesn't have the same string Before And After the value we are looking to extract. For Example:
ODODODODEFGH4OGOGOG
LALALALALABCDE12-1ALALALALA
IRIRIRIRIJKLMNOROROR
And I need to extract the following strings which are located in another sheet ((its an SKU information combining text and numbers with variable length) from column A and list it in the column B next to it
ABCDE12-1
EFGH4
IJKLMN
I've tried Find, Mid, Lookup, Index functions but can't seem to find the solution. Any help very appreciated!
Let's say your Sheet1 and Sheet2 looks like this.
Put this formula in Cell B1 of Sheet1 and pull it down.
=IF(SUMPRODUCT(COUNTIF(A1,"*"&Sheet2!$A$1:$A$3&"*")),INDEX(Sheet2!A:A,SUMPRODUCT(COUNTIF(A1,"*"&Sheet2!$A$1:$A$3&"*")*ROW(Sheet2!$A$1:$A$3))),"")
OK, now that we know you have a lookup table, set up the following:
On Some sheet, list your valid SKU's in a vertical Named Range. e.g: ValidSKU refers to: Sheet2!$A$2:$A$100
Then with your gibberish string on some sheet in A1, to return the valid SKU from the string:
B1: =INDEX(ValidSKU,LOOKUP(9E+307,FIND(ValidSKU,A1),ROW(INDIRECT("1:10000"))))
The "10000" argument in the above formula needs to be a number that is at least as large as the number of SKU's in your list. So if you have 5000 valid SKU's, use some number greater than that.
Then fill down as far as needed.
This method has a weakness: If there are overlapping SKU's, it will return the lowest one that matches. So it would be best to have your longest SKU's at the bottom of the list.
In other words, if you have two SKU's ABCDE12-1, and ABCDE12, both of those are found in your 2nd string. Whichever is located last in the ValidSKU list will be the one returned. I don't know of any way (other than position) to differentiate these two possibilities.