Extracting last year and month

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,509
Office Version
  1. 2021
Platform
  1. Windows
1) I have date month and year in cell S5 on sheet1 as for eg 22/03/2013 (dd/mm/yyyy)
2) I have the month and year in S4 in sheet1 for eg Feb 2013

I have the following formula in C5 on sheet extact ="To "&MID(Sheet1!S5,9,2)&"/"&CHOOSE(MONTH(Sheet1!S4),1,2,3,4,5,6,7,8,9,10,11,12)

This returns To 13/2

If the month is less than 10, then I would like to add a zero after / for eg To 13/02 (for Feb 2013) , 13/03 (march 2013) etc

Your assistance in resolving this is most appreciated
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Does this alternative do what you want?

Code:
="To " & TEXT(Sheet1!S5,"yy") & "/" & TEXT(Sheet1!S4,"mm")
 
Upvote 0

Forum statistics

Threads
1,203,456
Messages
6,055,543
Members
444,794
Latest member
HSAL

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