• 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
    • SALE 20% Off All Courses
    • 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
    • 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
    • Logout
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Cannot convert to a date format |General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Cannot convert to a date format |General Excel Questions & Answers|Excel Forum|My Online Training Hub

sale now on

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 ForumGeneral Excel Questions & Answe…Cannot convert to a date format
sp_PrintTopic sp_TopicIcon
Cannot convert to a date format
Avatar
Marty3280

New Member
Members
Level 0
Forum Posts: 2
Member Since:
August 26, 2017
sp_UserOfflineSmall Offline
1
August 26, 2017 - 3:25 am
sp_Permalink sp_Print

Hi.  First time posting.

I am using the following formula to concatenate a series of dates:

=IF($D$5="","","The expiration date(s) for all active(s) is(are): "&SUBSTITUTE(SUBSTITUTE(TRIM($D$9&" "&$U$9&" "&$AL$9&" "&$BC$9&" "&$BU$9&" "&$CL$9&" "&$DC$9&" "&$DT$9&" "&$EL$9&" "&$FC$9&" "&$FT$9&" "&$GK$9&" "&$HC$9&" "&$HT$9&" "&$JM$9&" "&$JB$9)," ","; "),";;","; "))

The result is:

The expiration date(s) for all active(s) is(are): 43890; 43900; 43353

When I use Number/Format/Date and choose a date format, nothing happens.  When I did that on the individual cells in the formula, the serial numbers converted to the date format I wanted.  I converted the original data to the same date format and it still didn't work.  I even tried the formula without the initial text string and no change in the result.  Any suggestions?  

Thank you very much,

Marty

 

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 858
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
2
August 26, 2017 - 9:21 am
sp_Permalink sp_Print

Hi Marty,

When you combine text and numbers in one cell like you do here Excel treats it as text, even the numbers.
Below is an example of how you can do to fix this. You can check the attached file for more details.

What you need to do is in a new row (or sheet for that matter) fetch the values from cells D9 to JB9 and format as text using TEXT function. In below example I use row 11, cells D11 to JB11. That formula would then be =TEXT(TRIM(D$6),"yyyy-mm-dd") to fetch the date serial number from cell D9 and convert it to text formatted as date.

Your new formula to show the result will be much shorter and instead of SUBSTITUTE you use TEXTJOIN. The new formula would then be =IF($D$5="","","The expiration date(s) for all active(s) is(are): "&TEXTJOIN("; ",TRUE,D11:JB11)).

Check out the attached file and you will see how it works.

Br,
Anders

Avatar
Marty3280

New Member
Members
Level 0
Forum Posts: 2
Member Since:
August 26, 2017
sp_UserOfflineSmall Offline
3
August 30, 2017 - 1:42 am
sp_Permalink sp_Print

Hi Anders.  Thank you very much for your help.  Unfortunately, TEXTJOIN is not an option in my version of Excel (2010).  When I started to type in TEXTJOIN, there were no other functions listed following TEXT.  Looks like I may still have to use SUBSTITUTE for the dates I converted to text following your suggestion. 

 

Thanks once again,

Marty

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 858
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
4
August 30, 2017 - 3:16 am
sp_Permalink sp_Print

Hi Marty,

True, TEXTJOIN came with Excel 2016 version. I hope you get it to work as you want it to be.

Br,
Anders

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 170
Currently Online: Velouria
Guest(s) 95
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 858
Velouria: 580
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 214
A.Maurizio: 202
Aye Mu: 201
Jessica Stewart: 189
Newest Members:
Vincent Starcevich
Patrick Lawrence
Louise Bell
GIJO GEORGE
Kumud Patel
Atos Franzon
Andrew MacDonald
Artie Ball
Jenn Cain
Peter Vandeweg
Forum Stats:
Groups: 3
Forums: 24
Topics: 6079
Posts: 26684

 

Member Stats:
Guest Posters: 49
Members: 31570
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, 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
trustpilot excellent rating
 

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.