Excel Formula - How to separate full name

shacol03

New Member
Joined
Oct 24, 2017
Messages
14
Hi,


Please help me regarding these below:


1st. How to get all capital letters in a cell. I want to get only the "DEL REY(AM)"

Sample: Alejandro Jay DEL REY(AM)


2nd. How to get the remaining full first name. I want to get only the "Alejandro Jay"




Thank you.
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

kweaver

Well-known Member
Joined
May 8, 2018
Messages
919
Office Version
365, 2010
There are a few ways. If you have Excel 365 or so, you can put: Alejandro Jay into B1 (assuming the full string is in A1) and then use Flash Fill from the DATA tab on the ribbon.
The same would apply to the location by typing JUST THE LOCATION (e.g., Del Ray(AM)) into C1 and using Flash Fill.

If not, you can extract just the name, assuming there is a space between the first and last name and a space after the last name, using:

Code:
=LEFT(A1,FIND(" ",A1,FIND(" ",A1)+1)-1)
You can extract everything AFTER the space which is after the last name using:

Code:
=RIGHT(A1,LEN(A1)-FIND(" ",A1,FIND(" ",A1)+1))
 
Last edited:

shacol03

New Member
Joined
Oct 24, 2017
Messages
14
Hi kweaver,

But can you help me how to get only the big letter in a Cell,
Example
1. Alejandro Jay DEL REY(AM), then I want only to get all capital letter which is "DEL REY(AM)"
2.
Filippo BERGAMASCHI , will get only the BERGAMASCHI


Regards,
 

tyija1995

Well-known Member
Joined
Feb 26, 2019
Messages
740
Office Version
365
Platform
Windows
Hey,

If the format is consistent in that the capitals always come at the end (and there are no other funny characters such as "[" etc) then try this:

Code:
Function NONCAPITALS(txt As String) As String
Dim rgx As Object
Set rgx = CreateObject("VBScript.RegExp")
    rgx.Global = True
    rgx.Pattern = "([A-Z]{2,})"
    NONCAPITALS = rgx.Replace(txt, "")
End Function
To use - lets say A1 = "Alejandro Jay DEL RAY(AM)"
B1:
Code:
TRIM(SUBSTITUTE(SUBSTITUTE(NONCAPITALS(A1),CHAR(40),""),CHAR(41),""))
C1:
Code:
TRIM(REPLACE(A1,1,LEN(B1),""))
B1 result: "Alejandro Jay"
C1 result: "DEL RAY(AM)"
 

AlKey

Active Member
Joined
Oct 15, 2013
Messages
395
Try this
Enter formula in cell B1 and drag formula across to C1

Code:
[B]=TRIM(MID(SUBSTITUTE(SUBSTITUTE($A1," ",",",2),",",REPT(" ",50)),50*(COLUMNS($A:A)-1)+1,50))[/B]
 

Forum statistics

Threads
1,089,381
Messages
5,407,923
Members
403,171
Latest member
mayesmail12

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top