How do I combine the first character of a cell with another cell in Excel? - excel

I have an Excel sheet with first names in Column A and surnames in Column B. I want to create a third Column C that contains the first character from the first name and adds it to the surname, creating first initial + surname.
First Name Last Name Combined Name
John Smith jsmith
How can I do this using Excel?

=CONCATENATE(LEFT(A1,1), B1)
Assuming A1 holds 1st names; B1 Last names

Personally I like the & function for this
Assuming that you are using cells A1 and A2 for John Smith
=left(a1,1) & b1
If you want to add text between, for example a period
=left(a1,1) & "." & b1

Use following formula:
=CONCATENATE(LOWER(MID(A1,1,1)),LOWER( B1))
for
Josh Smith = jsmith
note that A1 contains name and B1 contains surname

This is what formula I used in order to get the first letter of the first name and first letter of the last name from 2 different cells into one:
=CONCATENATE(LEFT(F10,1),LEFT(G10,1))
Lee Ackerman = LA

Not sure why no one is using semicolons. This is how it works for me:
=CONCATENATE(LEFT(A1;1); B1)
Solutions with comma produce an error in Excel.

QUESTION was: suppose T john is to be converted john T, how to change in excel?
If text "T john" is in cell A1
=CONCATENATE(RIGHT(A1,LEN(A1)-2)," ",LEFT(A1,1))
and with a nod to the & crowd
=RIGHT(A1,LEN(A1)-2)&" "&LEFT(A1,1)
takes the right part of the string excluding the first 2 characters, adds a space, adds the first character.

Related

How to compare two excel sheets list?

I have two sheets list both has the same data which is first name and last name. I want to know if list A has the same last name, and the first 3 character from first name from list B. I tried to use Vlookup function but I did not work. I want to match exact last name and exact three character from first name.
An example:
Worksheet 1
A B
1 John Smith
2 Jane Jones
3 Robert West
Worksheet 2
A B C
1 John Smith MATCH
2 Jane Jones MATCH
3 Bob West NO MATCH
In cell C1 on Worksheet 2 enter this formula as an array formula:
=IF(NOT(ISNA(MATCH(CONCATENATE(LEFT(A1,3),B1),CONCATENATE(LEFT(Sheet1!$A$1:$A$3,3),Sheet1!$B$1:$B$3),0))),"MATCH","NO MATCH")
Drag your formula down to include cells C2 and C3.
Notes
To enter as an array formula use CTRL + SHIFT + ENTER
Update the Left formula to match different numbers of characters in first name

Excel Find formula split string of names

I'm trying to split a list of names, They in the form of:
Surname, Title. Firstname (Nickname)
Jonesy, Mr. Cheese (Edam)
Bukowski, Mrs. Gertrude (Gerti)
I need to put them into Firstname Surname
It should be easy to pick up the Firstname: Two characters after the dot of Title up to the space before the left bracket of Nickname. Only my excel formula doesn't give me what I want.
A1 Smith, Mr. Andrew (Andy)
A2 =MID(A1,1,Find(" ",A1)-2)
A3 =MID(A1,Find(".",A1)+2, Find("(",A1)+1)
Only for A3 I get:
Andrew (Andy)
Instead of just the name Andrew
I'll add the caveat that I need the formula to refer to the name cell and not an cell with temp data to be referenced (ie an interim cell)
I can't see the woods for the trees on this one. Need to call in a bigger brain.
Assuming a data setup where headers are in row 1, with your "Complete Name" in column A starting in row 2, like so:
In cell B2 and copied down is this formula to get the first name:
=MID(A2,FIND(".",A2)+2,FIND("(",A2)-FIND(".",A2)-3)
In cell C2 and copied down is this formula to get the last name:
=LEFT(A2,FIND(",",A2)-1)
You can use this single formula to get the Firstname Surname:
=TRIM(MID(A1,SEARCH(".",A1)+1,SEARCH("(",A1)-SEARCH(".",A1)-1))&" "&MID(A1,1,FIND(" ",A1)-2)
Pretty Simple I think....(Famous last words).
You had:
A1 = Smith, Mr. Andrew (Andy)
A2 =MID(A1,1,Find(" ",A1)-2)
A3 =MID(A1,Find(".",A1)+2, Find("(",A1)+1)
I replaced the A# Find "(" with " " and it worked.
A1 = Smith, Mr. Andrew (Andy)
A2 =MID(A1,1,Find(" ",A1)-2)
A3 =MID(A1,Find(".",A1)+2, Find(" ",A1)+1)
This will only work if you have a single Firstname though. A name like Bobby Joe or Billy Bob will cut off at Bobby and Billy.

Excel Find Nth Instance of Multiple Criteria

I have 3 columns of data. Col A contains Names, Col B contains a client ID, Col C contains a date.
I'm trying to figure out how to write a formula that will find the top 2 and top 3 instances of a specific Name in Col A and client ID in Col B and return the value in Col C.
Trying to avoid using VBA, but not sure if this is doable.
So for example data looks like this and I would want to return that Sam dealt with Client ABC the 2nd time around on 12/16.
Sam ABC 12/3
Adam XYZ 12/5
John DEF 12/9
Sam ABC 12/16
Adam HIJ 12/18
Assuming
your headers are in A1:C1
your data starts from A3 (yes, not A2)
You enter the name in G2 & Client ID in G3 & you want the list of
dates starting from G5
Enter these formula/values:
A2: =G2
B2: =G3
C2: =0
G5:
=IFERROR(INDEX(($A$2:$A$500=$G$2)*($B$2:$B$500=$G$3)*($C$2:C$500),MATCH(0,COUNTIF($G$4:G4,($A$2:$A$500=$G$2)*($B$2:$B$500=$G$3)*($C$2:C$500)),0)),"End")
(Formula in G5 is an array formula; confirm this with Ctrl+Shift+Enter)
Drag the formula in G5 down until you see 'End'
Value in cell G5 will always be 0 or '1/0' based on your formatting.
The list of dates corresponding to the name & client ID combination will start from G6.
Let me see if I understood your need. Correct me if I'm wrong.
You want to be able to inform a Name and a Client ID and have Excel tell you the last 3 occurrences of that combination?
By "top 2 and top 3 instances of a specific name" I'm assuming you mean the top 2 and 3 dates found for that specific name and ID.
If so, try this:
Supposing you have your example data table starting at Cell A1 and ending at Cell C6 (including column headers) and that you'll enter the name in F1 and Client ID on F2
A B C
1 Name Client ID Date
2 Sam ABC 12/3
3 Adam XYZ 12/5
4 John DEF 12/9
5 Sam ABC 12/16
6 Adam HIJ 12/18
Type this formula where you want to return the date of the last occurrence:
=IFERROR(LARGE(IF($A$2:$A$6=$F$1,IF($B$2:$B$6=$F$2,$C$2:$C$6)),1),"-")
This should be entered as an Array Formula, so don't forget to press CTRL + SHIFT + ENTER or it'll not work.
To bring the 2nd last occurrence on another cell, just copy and paste the formula and change the number 1 to 2 (as indicated below):
=IFERROR(LARGE(IF($A$2:$A$6=$F$1,IF($B$2:$B$6=$F$2,$C$2:$C$6)),2),"-")
If you typed 'Sam' on F1 and 'ABC' on F2, this formula would return '12/16' as the last occurrence, '12/3' as the 2nd last occurrence and a dash (-) as the 3rd last occurrence, since there isn't one.
Of course, you'll have to adjust the ranges and other cell references accordingly in your real data set.
Hope this helps.

Excel macro/formula - replace cell values if value does NOT appear in another column

I need help. I have a list of 20 names of certain consultants. I receive a new sheet daily with many names, and if one of them does not match with any of the 20 consultant names, I need to replace the cell value with "X".
E.g.
1. Consultant's list contains John and Mary.
2. Daily list contains 5 names: John, Steve, Dean, Mary and Sue.
3. I now want to replace all the cell which does NOT contain John and Mary with X (thus replace cell with names Steve, Dean and Sue with X)
Help will be appreciated
If your 20-name list is in ColumnA and the daily list in ColumnB each starting in Row1 then in Row 1 and copied down to suit:
=IF(ISERROR(MATCH(B1,A:A,0)),"X",B1)

In Excel.. How do take the first letter of a name and add it to their last name in another column

In column E I have a list of 400 first names and in column F I have a list of their last names. How do I merge the first letter with the last name in another column. Column G is what I want in the below example.
Example
ColE ColF ColG
John Smith JSmith
Mike Tomas MTomas
Jill Lake JLake
Use the LEFT() function and the ampersand to concatenate
=LEFT(e1,1)&f1
This formula in column G will get what you want:
=CONCATENATE(LEFT(E1,1),F1)
=CONCATENATE(LEFT(E2,1),F2)
=CONCATENATE(LEFT(E3,1),F3)
...
In Column G, try
left(E1,1) & F1

Resources