I am trying to do a very simple task that does not give me the expected results:
I got the following excel table with columns A and B:
Column A
Mr. John Doh
Mario Bros
Dr. Frankenstein
Mickey Mouse
Donald Duck
Column B
Jenny Dart
john doh
Roger Rabbit
Frankenstein
I am extracting values with VLOOKUP comparing B to A
=VLOOKUP("*"&B1&"*";$A$1:$A$5;1;FALSE)
however the result is the following:
Mr. John Doh
#N/A
#N/A
#N/A
If I do the contrary so comparing A to B:
=VLOOKUP("*"&A1&"*";$B$1:$B$5;1;FALSE)
I get the following result:
#N/A
#N/A
#N/A
Dr. Frankenstein
In both cases I would expect to see "Dr.Frankenstein" and "Mr.John Doh" appearing in both results
however, it seems not the case.
Any idea why?
There are no extra spaces in the cells
There are no Typos in the cells.
I tested the index 1 and the index 2 with no luck.
TRUE cannot be used as I am having "*"
The ultimate goal is to have a long list of users and pulling out data comparing the columns considering that some cells contain title+name like: "Mr." or "Dr."
In the A column you have "Mr. John Doh" and in B "john doh" so when using Vlookup to search john doh in A, it finds it. But in case you are searching "Mr. John Doh" it can't be successful because of the "Mr. " part of the string.
The same case with Frankenstein and Dr. Frankenstein in the other example. Strip the titles ("Dr", Mr. etc) and it will work.
Having some issues with my formula and I'm hoping to find some help here.
This is my formula:
=IFERROR(REPLACE(F7, FIND("BOB",A2), 13, "Other"),A2)
I have 3 names in my data (Column B):
Bob
Sarah
Lee
What I want to do is find "Bob"'s name and in column C return it as "Other", and I want Sarah to return as Sarah and Lee to return as Lee.
With my formula, currently it's returning everyone's name as "Open" and I'm not quite sure why.
Any recommendations?
Use:
=IF(ISNUMBER(FIND("Bob",A2)),"Other",A2)
one thing to remember FIND is an exact match while SEARCH does not care about case.
So if Bob can be BOB and Bob then you may want to use SEARCH
=IF(ISNUMBER(SEARCH("Bob",A2)),"Other",A2)
An alternative to #ScottCraner's answer.
It is unclear if you want only "Bob" to result in "Other", or if you want anything other than "Sarah" or "Lee" to result in "Other".
If you want the latter, you can use this array formula:
= IF(MAX(IFERROR(FIND({"Sarah","Lee"},A2),0))=0,"Other",A2)
Note this is an array formula so you must press Ctrl+Shift+Enter on your keyboard after typing the formula rather than just Enter.
I have a cell which contains a description like the one below
"customer enjoys playing cricket and football."
Then on another worksheet I have a list of sports
Cell / Sport
A1: Tennis
A2: Football
A3: Golf
A4: Boxing
A5: Hockey
A6: Cricket
I need iterate through the list of sports and match the first sport in the list and then print it. Here are some examples of what I'd like to return.
Description / Sport (These are defined under 'Name Manager' as 'SPORT_NAMES')
"customer enjoys playing cricket and football." / Football (Because Football is in A1 and cricket is only in A6)
"customer is playing golf today." / Golf
"shall we play tennis or golf today" / Tennis
I am able to do it for each cell using the following formula
=IF(ISNUMBER(SEARCH(Sports!A1,Data!A2)), "Tennis", "")
Thanks,
Kieran
=INDEX($A$1:$A$6,MATCH(1,--ISNUMBER(SEARCH($A$1:$A$6,E1)),0)) - This is an array formula (enter the formula by using Ctrl+Shift+Enter while still in the formula bar)
By using a double unary operator you convert the TRUE / FALSE result of ISNUMBER(SEARCH($A$1:$A$6,E1)) to 0 or 1 respectively.
I then use MATCH() as the return value for INDEX() to get the appropriate result (which will always be the first occurrance)
I'm pretty sure there is a clean and nice way of doing this, but at least, this answer will work.
First of all. I strongly encourage you to list the sports as in my screenshot, with an auxiliary column that shows the importante of each sport. Thay way you can reorder as you want or change positions and remember priority:
Then, I used this dirty formula to get the results:
=IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IF(SEARCH('LIST OF SPORTS'!$B$2;Hoja1!A1)>0;'LIST OF SPORTS'!$B$2);IF(SEARCH('LIST OF SPORTS'!$B$3;Hoja1!A1)>0;'LIST OF SPORTS'!$B$3));IF(SEARCH('LIST OF SPORTS'!$B$4;Hoja1!A1)>0;'LIST OF SPORTS'!$B$4));IF(SEARCH('LIST OF SPORTS'!$B$5;Hoja1!A1)>0;'LIST OF SPORTS'!$B$5));IF(SEARCH('LIST OF SPORTS'!$B$6;Hoja1!A1)>0;'LIST OF SPORTS'!$B$6));IF(SEARCH('LIST OF SPORTS'!$B$7;Hoja1!A1)>0;'LIST OF SPORTS'!$B$7));"No sports found")
And in Sheet1 I get this:
Hope this can help you out.
I need a little help: I have to cross match Database A user names(firstname lastname) with Database B where there are some extra characters and the order is last name firstname), so the normal vlookup does not find exact match. I tried the following: I used text to column from the Database A, to have two separate column, then I tried to find the name from Database B
=IF(IF(ISNUMBER(SEARCH(A1,C1)),ISNUMBER(SEARCH(B1,C1))),"yes","no")
This show correct result when the name is in the same line
A1 Tom
B1 John
C1 John dr tom -
The results is true(yes), but in case:
A1 Tom B1 Jon C2 John dr tom - the result are false(No)
I need to same at Database A which is a appearing at Database 2. So I need to find the duplicated items.
Can you help me out how to correctly find what I am looking for?
=VLOOKUP(""&B1&"" &""&A1&"",F:F, 1,FALSE) This was the answer, I managed to figure out.
I am wondering if there is a way to replace a cell value from another list without having to write a VB script.
Here is the problem I am trying to resolve:
I have last names in a column:
Smith
Jones
Taylor
etc.
I have another column with IDs e.g.
Smith_ID
Taylor_B
Jones_C
I would like to replace Smith with Smith_ID, Jones with Jones_C etc. Obviously my list is much longer than 3 entries.
He can do it.
Extract column IDs with "_" character by "Text to Columns"
A column
Smith
Jones
Taylor
B column
Smith
Taylor
Jones
C column
ID
B
C
Now write to following formula
=CONCATENATE(A1;"_";VLOOKUP(A1;$B$1:$C$3;2;FALSE))
I hope you do
If you have a common value between the 2 lists, then you can use Vlookup() (see link for better examples) to match the 2.
Using your example, you have Sheet1 that says:
Smith
Jones
Taylor
In Sheet2, you have:
Smith 4
Jones 9
Taylor 6
Then do this:
In Sheet1, add a column with the formula =vlookup(A1,Sheet2!$A$3:$B$3,2,False). This will return 4 for the 1st row, 9 for the 2nd, etc.
(Optional) If you want to get rid of the original values completely, you can then copy&paste values and delete the original column OR just hide the original column.
Is this what you're looking for?
To answer this question under general situation, suppose you have two columns as followed:
A Smith,Jones,Taylor,Kevin,Yell,Ashton...
B John Harvard, Yell USC, Kevin Cruise, Ashton Bond, Smith Stone, Taylor Shift...
The classic case here is that you have two pretty much alike columns only with slightly difference. It could be a typo or some other mistakes.
What you want to do is to replace cells'value in column A by them in column B, if we assume that column B is the right thing you want.
So for each cell in A, you want to know the position of its approximate match in column B. For example, given A1(Smith), you want to know where Smith Stone is, in this case, B5.
Begin with a new column C, combined with match function and wildcard, filled C1 by the following formula:
row_index=match(A1&"",$B$1:$B$6,0)
you now extract row_index of every approximate match corresponding to column A. Then by using
=index($B$1:$B$6,row_index,0)
which returns you "Smith Stone" in cell C1. Same for other cells.
*Remark: The biggest flaw for this method is that it kind of requires the approximate match in B for each cell in A should be unique.
I had 2 columns, one was an Vendor Name, the 2nd was the Vendor Address but it also contained the Vendor Name. I needed to strip out the Vendor Name which would leave me with the Vendor Address without the Name.
For example if one column had "Con Ed", the next column had "Con Ed 123 Street, New York, NY 11111", I needed to replace "Con Ed" with null and just have "123 Street, New York, NY 11111" in a column.
Here's what I did and I will also let you know what you can do to accomplish your goal.
First I created a new column and set that to the Length (using the LEN() function) of the Vendor Name.
Then I created another new column and set that to the length of the Vendor Address.
A third column and was set to use the Right() function. Where the text is the Vendor Address and the length is the Length of the Address minus the length of the Vendor Name.
So consider: "Con Ed 123 Street, New York, NY 11111"
1st column: (Length of Vendor): len(Con Ed) = 6
2nd column: (Length of Vendor address): len(Con Ed 123 Street, New York, NY 11111) = 37
3rd Column: Right([Vendor Address], 31 (37-6)) = ", New York, NY 11111"
Lastly I just applied the TRIM function to the 3rd column.
In your case you would just want to use the Concatenate function to append the the original column & the new column.
So in summary you'll have the below columns:
Column 1: Names:
(Smith,Jones,Taylor)
Column2: IDs:
(Smith_ID,Taylor_B,Jones_C)
Column3: Len([Names])
Column4: Len([IDs])
Column5: The "replace" function
= TRIM(Right([IDs], ([Column4] -[Column3] ))
Column6: String put back together
=Concatenate([Column3],[Column5])
=INDEX('All_Linguists_All_ProjectsFri J'!$DA$2:'All_Linguists_All_ProjectsFri J'!$D$71355,MATCH(A2,'All_Linguists_All_ProjectsFri J'!C:C,FALSE),1)
Dont have time to explain it, but if you know how to write formulas in excel, this should be useful. Sorry for not explaining.
Hope you are using excel and in that you want to replace value of one cell of raw from another cell of same raw and this has to be done for entire column and not form selected raw.
In this case you can copy the values which you want to kept (i.e. ID column) and then pest the same in column Last name.
If values are in same raw then there is no problem and from your query it appears that values are in same raw.
I use this formula when searching cell B1 for the letter "s", if found then I concatenate the word "addition" to the value of cell A1 otherwise just take the value of cell A1.
=IF(ISNUMBER(SEARCH("s",B1))=TRUE,CONCAT(A1, " addition"),A1)