Convert date/time to reporting period

West Man

Well-known Member
Joined
Mar 27, 2006
Messages
1,175
I am close but not quite there. I have date/times that need to be converted into reporting periods. Reporting periods will be 1, 2 etc.
Period 1 is an exception it begins at start of day on 6/6 and runs thru 11:59:59 the same day.
Period 2 then begins at 12:00:00 (noon) on 6/6 and runs thru 11:59:59 on 6/7.
Subsequent periods are like period 2 beginning at noon running thru 11:59:59 the following day.

I am close with =ROUNDDOWN(CEILING(X2-42129,0.5),0) but times at noon present problems. Suggestions?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
have a lookup table that tells you 6/6 is 00:01 to noon and ALL other dates are noon start 24 hours long

row 1 col 1 will be 6/6 00;00 col 2 11:59;59
row 2 col 1 will be 6/6 11:59:59 col 2 6/7 11:59;59 etc
 
Upvote 0
Thank you. I was trying to avoid the table and because the problem only existed with noon, I have amended my formula as follows ROUNDDOWN(CEILING(X2-42129,0.5),0)+(MOD(X2,1)=0.5) which appears to have worked.

Thank you again for your time in considering my problem.
 
Upvote 0

Forum statistics

Threads
1,203,238
Messages
6,054,312
Members
444,715
Latest member
GlitchHawk

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