Trim a date

EvansB2

Board Regular
Joined
Nov 25, 2008
Messages
245
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I have a long list of dates as presented in cell A1 below and would like to 'trim' it to only show the year in cell B1. Any assistance would be gratefully received as the list is very long!

Regards

Ben

[TABLE="width: 182"]
<colgroup><col width="35" style="width: 26pt; mso-width-source: userset; mso-width-alt: 1280;"> <col width="105" style="width: 79pt; mso-width-source: userset; mso-width-alt: 3840;"> <col width="103" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;"> <tbody>[TR]
[TD="class: xl65, width: 35, bgcolor: #D9D9D9"] [/TD]
[TD="class: xl68, width: 105, bgcolor: #D9D9D9"]A[/TD]
[TD="class: xl69, width: 103, bgcolor: #D9D9D9"]B[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]1[/TD]
[TD="class: xl70, bgcolor: transparent"]01-04-2002[/TD]
[TD="class: xl64, bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="class: xl67, bgcolor: #D9D9D9"]2[/TD]
[TD="class: xl64, bgcolor: transparent"] [/TD]
[TD="class: xl64, bgcolor: transparent"] [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Thanks. I did try that, however, when I got your reply I then realised that the data was not in number format as so I got a "#N/A"

Ben
 
Upvote 0
surely should be in date format no? try the below instead...

=RIGHT(TRIM(A1),4)
 
Upvote 0
might have to be the below actually

=RIGHT(TEXT(A1,"dd-mm-yyyy"),4)
 
Upvote 0
Sorry, I mean the data was downloaded from a web site in excel and needed formatting.
 
Upvote 0

Forum statistics

Threads
1,225,741
Messages
6,186,761
Members
453,370
Latest member
juliewar

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