Can you group dates in a pivot table by the 1st-15th and from 16th to EOM?

eMHDfNhuwLhQCzJ

New Member
Joined
May 4, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello.

I am trying to group dates in a pivot table by pay period.

The pay periods extend from the 1st of each month to the 15th for the first half and then from the 16th to whatever the last day in the month is.

In the date grouping options I can only find the ability to group dates by the number of days which won't work. January ends up being grouped:
Jan 01-15
Jan 16-30
Jan 31-Feb 14

It should simply be grouped:
Jan 01-15
Jan 16-31
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You can probably do it if you load it into the datamodel and use Power Pivot and DAX.
For a normal pivot I always just used a helper column in the datasource for grouping. Its a simple if statement.
I would probably still use the month from the date in a column and something like this in a second column to ensure it sorts correctly.

Book5
AB
1DateMth Group
21/01/20221st Half
34/01/20221st Half
47/01/20221st Half
510/01/20221st Half
613/01/20221st Half
716/01/20222nd Half
819/01/20222nd Half
922/01/20222nd Half
1025/01/20222nd Half
1128/01/20222nd Half
1231/01/20222nd Half
133/02/20221st Half
146/02/20221st Half
159/02/20221st Half
Sheet1
Cell Formulas
RangeFormula
B2:B15B2=IF(DAY(A2)<=15,"1st Half","2nd Half")
 
Upvote 0
Solution
Ah. I was hoping to somehow do it with pivot tables only but this will work perfectly thank you very much.
 
Upvote 0
You're welcome. Sorry there isn't a pure pivot table solution.
At least this method works for multiple scenarios, especially if you throw in a grouping table and use Vlookup with the True (approximate match) parameter.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,144
Members
453,021
Latest member
Justyna P

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