![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: georgia
Posts: 9
|
does anyone have a formula for converting numbers to dates.
ex. 03282002 = 03/28/2002 Thanks |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Quote:
But, that ASSUMES that the text length is 8 characters. I mean, month 3 is shown as 03 and day 8 is shown as 08 |
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
if 03282002 is in cell B11, then use =DATE(RIGHT(B11,4),LEFT(B11,2),MID(B11,3,2))
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi Juan:
We might have been posting at the same time! |
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Location: georgia
Posts: 9
|
thanks to both of you, what if the month is not always two digits.
on my spreadsheet excel is dropping the leading 0 3282002 thanks again |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
What about the Day ? does it always have 2 digits ?
|
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
How about this formula ?
=DATE(RIGHT(A11,4),LEFT(A11,(LEN(A11)=8)+1),MID(A11,(LEN(A11)=8)+2,2)) |
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
[ This Message was edited by: Mark W. on 2002-03-28 14:40 ] |
|
|
|
|
|
|
#9 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Quote:
|
|
|
|
|
|
|
#10 | ||
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
If you're concerned about the dashes instead of slashes... it makes no difference. |
||
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|