# Date formatting not working

#### jokkebal

##### New Member
I receive a file with a date in the format e.g. 20111025. So this example signifies October 25th, 2011. I need the ability to work with it as a true date (in furhter downstream formulas). This is what I did : assuming that 20111025 stands in A1, I would enter following formula in B1 : =CONCATENATE(RIGHT(RC[-1],2),""/"",MID(RC[-1],5,2),""/"",LEFT(RC[-1],4)). This results in 25/10/2011. I then copy this formula, paste it as a value and format the cell as date (short). BUT : it doesn't work : another formula downstream does not recognise this result as a date.

Strange : when I press F2 "edit" on the cell, it works. Problem is that I have many lines, so I have to press F2 - down - F2 - down - F2 - down etc etc.

How can I resolve this ?

### Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

#### Special-K99

##### Well-known Member
Try

=DATEVALUE(CONCATENATE(RIGHT(RC[-1],2),""/"",MID(RC[-1],5,2),""/"",LEFT(RC[-1],4)))

or even

=CONCATENATE(RIGHT(RC[-1],2),""/"",MID(RC[-1],5,2),""/"",LEFT(RC[-1],4))+0
Note +0 at the end

#### Jonmo1

##### MrExcel MVP
Try

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

#### MickG

##### MrExcel MVP
You could try this for a list of dates in colun "A"
Code:
``````[COLOR="Navy"]Sub[/COLOR] MG27Aug02
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
Dn.Value = DateSerial(Mid(Dn, 1, 4), Mid(Dn, 5, 2), Mid(Dn, 7, 2))
[COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]``````
Regards Mick

#### jokkebal

##### New Member
Hi all,

Thanks for your prompt and numerous replies.
I tried

=CONCATENATE(RIGHT(RC[-1],2),""/"",MID(RC[-1],5,2),""/"",LEFT(RC[-1],4))+0

This works perfectly.

Rgds.

Replies
2
Views
402
Replies
5
Views
585
Replies
3
Views
540
Replies
2
Views
205
Replies
4
Views
223

1,195,671
Messages
6,011,077
Members
441,581
Latest member
rp4717

### 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.

### Which adblocker are you using?

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

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