concatenate formula with text and date is returning wrong format

thewiseguy

Well-known Member
Joined
May 23, 2005
Messages
1,015
Office Version
  1. 365
Platform
  1. Windows
Hi All, here is my current formula:

=CONCATENATE(B5," ",F5)

B5 = 2024-08-29
F5 = Cedarcrest

Output = 45533 Cedacrest

I need this to say "20240829-Cedarcrest"

Can anyone help with these adjustments?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
=TEXT(B5,"yyyymmdd")&"-" & F5

excellent thank you! So "Cedacrest" is actually "Cedarcrest Property Management"

1 other request.....is it possible to remove the spaces in B5, so that the output it:

20240829-CedacrestPropertyManagement
 
Upvote 0
You can use the TRIM() function to remove spaces from text:
Excel Formula:
=TEXT(B5,"yyyymmdd")&"-" & trim(F5)
 
Upvote 0
The spaces may be other non-printable characters that just look like spaces. Does
Excel Formula:
=SEARCH(" ",F5)
return a number?
 
Upvote 0
TRIM isn't the function you need, SUBSTITUTE is:
=TEXT(B5,"yyyymmdd")&"-" & SUBSTITUTE(F5," ","")

TRIM doesn't remove all spaces, it removes leading and trailing spaces as well as extra ones in the text.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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