Transform Date field by using custom parameter

brothaprice

New Member
Joined
Dec 12, 2020
Messages
13
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Web
How can transform a date field called "FinalDate" not using the standard date parameters? I would like to transform it by the year and whichever half of the month it is. The 1st half of the month would constitute the first 15 days of the month and the 2nd half would constitute the remaining. So May 2019-1st half for example. How can I do this?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Here's a solution using DAX column (go to Data > select your table > Column tools > New column):

Rich (BB code):
    FinalDate = 
        var Half = MIN(ROUNDUP(DAY(tblDates[Dates]) / 15, 0), 2)
    return
        FORMAT(tblDates[Dates], "mmm yyyy") & " - " &
        IF(Half = 1, "1st half", "2nd half")

1613042956120.png
 
Upvote 0
or formula where b1 contains your date
=IF(DAY(B1)<=DAY(EOMONTH(B1,0))/2,CONCAT(TEXT(B1,"mmm yyyy"),"-1st half"),CONCAT(TEXT(B1,"mmm yyyy"),"-2nd half"))
 
Upvote 0

Forum statistics

Threads
1,223,734
Messages
6,174,189
Members
452,550
Latest member
southernsquid2

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