• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Need to separate two names with something|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Need to separate two names with something|Power Query|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryNeed to separate two names with som…
sp_PrintTopic sp_TopicIcon
Need to separate two names with something
Avatar
P B
Member
Members
Level 0
Forum Posts: 38
Member Since:
March 8, 2021
sp_UserOfflineSmall Offline
1
April 15, 2021 - 11:08 am
sp_Permalink sp_Print

Hi,

Somebody send me a file and I could not figure out if they were last name, first name, and middle name or they were actually two person names.

I thought their names are so weird. To make sense I thought that I should add at least 'And' or '&' between these 2 people. It looks it is going to be easy but I have not been able to achieve the exact result.

It has only 7% data and 93% blank. When I brought to Power Query, 70% showed me null and 23% showed me nothing. I could not figure out any solution for that 23%.  I tried to replace the value of space with null but it does not like null.

 

I want to add 'And' or '&' before the last name from the right side. So that I know that these are 2 people. 🙂

 

How do I approach? I really need help. Thanks

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4519
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
April 15, 2021 - 8:33 pm
sp_Permalink sp_Print

Hi PB,

First split the column based on the last space delimiter, then merge it back together with the ampersand. See attached.

Mynda

Avatar
P B
Member
Members
Level 0
Forum Posts: 38
Member Since:
March 8, 2021
sp_UserOfflineSmall Offline
3
April 15, 2021 - 9:47 pm
sp_Permalink sp_Print

Hello Mynda,

Thank you so much! The problem is where there are 93% null and empty. I can add '&' but then it shows & in other 93% of records

&

&

&blank

&blank

That is what is causing the problem. Any advice about this?

Thanks

PB

Avatar
P B
Member
Members
Level 0
Forum Posts: 38
Member Since:
March 8, 2021
sp_UserOfflineSmall Offline
4
April 15, 2021 - 10:25 pm
sp_Permalink sp_Print

Please look at the screenshot. Thanks

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4519
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
5
April 17, 2021 - 9:16 am
sp_Permalink sp_Print

Hi PB,

It would have saved us both time if your original example file illustrated the problem. 

You can just use a custom column to ignore blanks or nulls (assuming there is data in other columns that you want to keep, otherwise I'd just remove the blank and null rows before splitting.

After the Split Column step you can add a Custom Column with this formula:

= if [Name.2] = null then null else [Name.1] &" & " &[Name.2]

Mynda

Avatar
P B
Member
Members
Level 0
Forum Posts: 38
Member Since:
March 8, 2021
sp_UserOfflineSmall Offline
6
April 18, 2021 - 9:32 am
sp_Permalink sp_Print

Hello Mynda,

Thank you! Yes, my mistake I thought that since I wrote about nulls and empty and blanks so it was clear but maybe not. Now it worked. Thanks

 

BTW, I was able to do it another way also. Try it with Column From Examples. There are some tricks when using Column From Examples but if you know what is the result, your brain goes that way and changes the steps. This was tricky but I was able to do it. Please try it and let me know if you were able to do it with Column From Examples. I am curious to know since I want to know that I was able to trick Column From Examples because I was so desperate or it was just easy. It took me many trials.

Thanks,

PB

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4519
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
7
April 18, 2021 - 10:03 am
sp_Permalink sp_Print

Hi PB,

Glad it worked now.

I had to give Column by Examples 5 examples before it realised the pattern, but you can also use that technique if you prefer. It makes no difference because the underlying process is still the same i.e. you can see in the formula it's splitting the text by delimiter and then joining it back together.

Mynda

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Velouria, jonhn wikal, Alain Balken, David du Toit
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Karen Newman
Aminu Sule
Samuel Ramirez
Abdifatah Osman
mohad borhom
Abayomi Adedeji
Ganesh MVS
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Forum Stats:
Groups: 3
Forums: 24
Topics: 6364
Posts: 27830

 

Member Stats:
Guest Posters: 49
Members: 32347
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.