Concatenate fields while removing hyphens and spaces

ExcelNoobInFL

New Member
Joined
Jun 4, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. MacOS
Hi all!
New here and so grateful for any help you can provide. This is probably easy, but I searched for quite awhile and couldn't find an answer specific to this situation. I have first name in A1, last name in A2, and trying to concatenate first and last name and add an email domain. This works great, but I need to remove spaces or hyphens from people with two last names.
I'm currently using:
=LOWER(CONCATENATE(A2,"",B2,"@gmail.com"))
which works great, but doesn't remove spaces or hyphens.

Thanks in advance!
Jonas
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi & welcome to MrExcel.
How about
Excel Formula:
=LOWER(CONCATENATE(A2,"",SUBSTITUTE(SUBSTITUTE(B2,"-","")," ",""),"@gmail.com"))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,201
Members
449,214
Latest member
mr_ordinaryboy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top