Hi BM ,
I don't think there can be a shorter formula , if I have understood your problem correctly.
The information you have given viz. that in some cases , the length of your data is 5 , and in some cases it is 10 , leads me to believe that your date format is mm-dd-yyyy. Dates in Excel are just numbers ; a valid date such as November 22 , 2012 ( today's date ) is just a number 41235 , formatted to display in any valid date format. However , in my system , since my date format is mm/dd/yyyy , this will be recognized by Excel as a valid date only if I enter it as 11/22/2012 or in any of the other acceptable variants , such as Nov-22 , 22-Nov ,... However , if I enter 22/11/2012 , Excel cannot interpret it as a valid date ; instead it takes this as a piece of text.
A valid date , which is just a number , will have 5 digits ; at least , any date after May 17 , 1927 !
Any date which has been interpreted by Excel as text , can have 9 or 10 digits , depending on whether you use the leading 0 for single-digit values.
So we have four possible conditions :
1. Data in both the columns ( e.g. A2 and B2 ) are valid dates
2. Data in the first cell is a valid date , while the data in the other cell is text
3. Data in the first cell is text , while data in the other cell is a valid date
4. Data in both the cells is text
Any correct formula has to take care of all 4 conditions ; with this constraint , whether you can have a shorter formula is a difficult question to answer ; in my opinion NO. You may get a formula which is a few characters less in length if you use the DATE function instead of the DATEVALUE function , but I don't think that is a great improvement. Of course , the easiest way to reduce the lengths of formulae is to use helper cells / columns.
Narayan