Search Duplicate Cells in Column and Incrementally Append Number to create Unique Value - excel

I have a column that has duplicate entries. I need to create unique values for each entry by adding a number to the end of it.
Example:
Column A
John Doe
Jack Tee
John Doe
Column B (solution Column)
John Doe
Jack Tee
John Doe 1
I searched a lot and couldn't find an answer! Any help is appreciated.
I'm using Microsoft (excel) 365 and running the latest version, if that makes any difference.

Countif can do that for you:
=IF(COUNTIF(A$2:A2,A2)>1,A2 & " " & COUNTIF(A$2:A2,A2)-1, A2)

Related

Excel Function - If string from column A is found in Column B Then

Column A has a list (first and last names) of all users who have an O365 license. Column B has a list of everyone in the company. Column C is associated with Column B and has the job title of everyone in the company.
I want each row in A to check all of B to see if they match. If they match I want to take the corresponding row in column C and copy/paste it into the same row in blank column D
A (O365 License
B (All Employees
C (Job Title).
D (JobTitle)
John Smith
Jarvis Cobblepott
. IT Guy
Nancy Johnson
John Smith
. Receptionist.
Kevin Gordon
Henry Kissinger
Marketing
Use ISNUMBER(MATCH()) to see if it exists:
=IF(ISNUMBER(MATCH(B2,A:A,0)),C2,"")
Alternatively maybe:
=XLOOKUP(A2,B$2:B$4,C$2:C$4,"",0)
Or:
=BYROW(A2:A4;LAMBDA(r,X.XLOOKUP(r,B2:B4,C2:C4,"",0)))

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

Excel - Append cell2 to cell1 if cell3 is not blank

All,
I've taken a browse around and I've been unable to nail down the formula I'm looking for. I'm a bit new to Excel expressions, so this is all part of the learning process.
My quandary:
I have a list of names in an Excel spreadsheet - some have two components and some have three. I need all names to have only two components - if they have three, then the first two components need to be combined.
Here is my workflow:
IF cell 3 is occupied, append the content of cell 2 to the end of cell 1 IN cell 1. Then, assuming cell 2 is now blank, move the content of cell 3 to cell 2. Else, do nothing.
So my input might be (assuming each group of characters is in its own cell):
JOHN SMITH
JOHN DOE SMITH
BARRY JOHNSON
RICHARD P RICKSON
JACK JACK GILES
My output would be:
JOHN SMITH
JOHNDOE SMITH
BARRY JOHNSON
RICHARDP RICKSON
JACKJACK GILES
What's your take on this?
Assuming your data is in columns A, B, and C, this will put the correct output in columns D and E.
In column D:
=IF(ISBLANK(C1),A1,CONCAT(A1,B1))
In column E:
=IF(ISBLANK(C1),B1,C1)

Find repeat names in column B based on date criteria in column A

I have two columns of data in Excel. Column A is an interaction date, and column B is a name. I'm looking to devise a way to identify repeat contacts by the same name that occur within 1 day of each other. eg:
Date Name
2016/01/01 John Wayne
2016/01/01 Paul Friesen
2016/01/01 John Wayne
2016/01/01 Alex Roschenko
2016/01/02 Paul Friesen
2016/01/02 Peter Mansbridge
2016/01/02 Jake Snake
2016/01/03 Paul Feig
2016/01/03 John Wayne
Using only this sample data, the result I would be looking for is 2 (John Wayne and Paul Friesen both repeated in =< 1 day.
I'm not sure if Excel or Access are the better tool to use for this, but I'm more experience in Excel, I just haven't been able to come up with a formula...
Use a helper column.
In a blank column put the following in row 2:
=SUM(COUNTIFS(B:B,B2,A:A,A2+{-1,0,1}))>1
This will return a column of TRUE/FALSE
Then referencing the helper column we use the following array formula:
=SUM(IF($C$2:$C$10,1/COUNTIFS($B$2:$B$10,$B$2:$B$10,$C$2:$C$10,TRUE)))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter when exiting edit mode instead of Enter. If done properly then Excel will put {} around the formula.
This formula counts the unique names that have TRUE in the helper column. So no matter how many times the name has TRUE next to it, it will only be counted once.

VLOOKUP to check if a value exists in a cell

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)

Resources