VLOOKUP to check if a value exists in a cell - excel

I have data like this in a column:
John L. Doe
Jane N. Doe
Michael A. Doe
I'm trying to match the entries against another column with this format.
doe, jane
doe, john
doe, michael
I've tried VLOOKUP's for the lastname and using wildcards:
VLOOKUP("*" & A1 & "*",B:B,2, FALSE)
but I'm getting #N/A as a result.

If your columns are labelled, then in C2 and copied down to suit:
=MATCH(TEXT(MID(B2,FIND(" ",B2)+1,LEN(B2))&"*"&LEFT(B2,FIND(",",B2)-1),"#"),A:A,0)
should return the row number of a match in ColumnA for the value in ColumnB that is in the same row as the formula result.
To match "the other way around" is very similar, and as it happens for the example the results the same:
=MATCH(TEXT(MID(A2,FIND(" ",A2,FIND(" ",A2)+1)+1,LEN(A2))&"*"&LEFT(A2,FIND(" ",A2)-1),"#"),B:B,0)

Related

Logic function to combine all matching text into one cell

I am looking for help with a formula that looks for all matching text and combines the results into a single cell. For example if the Country is Colombia I want a single cell to list all of the names that match Colombia.
ColA ColB
A1: COUNTRY NAME
A2: Argentina John Doe
A3: Bahamas Jan Doe
A4: Colombia James Doe
A5: Colombia Jason Doe
A6: Colombia Julian Doe
I've toyed around with CONCANTENATE and MATCH however they don't seem to be getting me what I need.

Count repetitive values in column B based on unique value in column A

I have the following table:
1 John Doe
John Doe
2 Adam Smith
Adam Smith
Adam Smith
I need to count the number of times a name appears for each number value in column A. The numbers are unique.
Place this formula in cell C1 and drag down until the end.
=IF(ISNUMBER(A1),COUNTIF(B:B,B1),"")
n.b. - you can more clearly define row numbers instead of using B:B if you like as well

If Cell Contains XXX Then Return Corresponding Value

A B C D
1 Ross Sales John Guys Finance
2 Smith Sales Sam Andy #N/A or False
3 Guys Finance Mike Ross Sales
I'm putting this formula in cell "D1" but it's not giving me correct result
=IF(SUMPRODUCT(--ISNUMBER(SEARCH(A:A,C:C)))>0,B:B)
INDEX MATCH function would not work because it's not exact value
What can I put in "D1" and down to give me result as in the table above?
Try this in D2,
=LOOKUP(1E+99, SEARCH(A2, C:C), B:B)
'or cut down the full column references
=LOOKUP(1E+99, SEARCH(A2, C$2:C$4), B$2:B$4)
'alternately as a wildcard MATCH
=INDEX(B:B, MATCH("*"&A2&"*",C:C, 0))
Fill down as necessary.
      

How to use the filter selection as a text header in another cell in Excel

I am trying to create a header cell based on the results of a filter applied to a column. For example I have a filter that lists results based on name. I am trying to pull a unique list or the filter selection and display the result in another cell:
Example:
Column G Filter Results: (selecting only Doe, John and Smith, Jane from multiple choices)
Doe, John
Doe, John
Smith, Jane
Doe, John
Smith, Jane
What I want to do is to display a unique result in Column A1 of:
Doe, John: Smith, Jane
Simply referencing the filter selection as a text literal would make the most sense, but I have no idea how to reference that in Excel
I am using Excel 2007

Excel - Match data from column and get the value next to it

Is there a formula that match data, get the value next to it, and then post that value into another cell?
This is what my excel sheet looks like:
Sheet A
Column A | Column B | Column C | Column D
----------------------------------------------------------
Bob John Cat
John Sue Dog
Sue Bob Duck
John owns a cat, Sue owns a dog, and Bob owns a duck. I want to match Column A to Column C and then grab the value right next to Column C and then put that value back into Column B.
This is the result that I want:
Sheet A
Column A | Column B | Column C | Column D
----------------------------------------------------------
Bob Duck John Cat
John Cat Sue Dog
Sue Dog Bob Duck
Thanks in advance!
Here's a solution using the VLOOKUP() function. Enter the formula in cell B1 and pull it down. You might need to edit your range aswell.
=VLOOKUP(A1;$C$1:$D$10;2;0)
*you might need to change ; with , depending on your language settings.
You could use vlookup (as you've tagged your question) but combining index and match is a much more versatile way of doing this (it doesn't require the the lookup row to be on the left side and is also more efficient).
Assuming row 1 contains headers, you could use the following formula in column B:
=index($D$2:$D$4,match(A2,$C$2:$C$4,0))

Resources