How to round dates up?

imdt3000

New Member
Joined
Dec 16, 2010
Messages
6
I need to round all dates that are between the 2nd and 15th (both #'s included) up to the 15tht and all dates that are between the 16th to the 31st (both #'s included) to the 1st of the next month.
Thanks
 

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Dannyh1

Well-known Member
Joined
Nov 18, 2009
Messages
1,144
Try:

=IF(AND(DAY(A1)>=2,DAY(A1)<=15),VALUE(15&"/"&MONTH(A1)&"/"&YEAR(A1)),VALUE(1&"/"&MONTH(A1)+1&"/"&YEAR(A1)))
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Perhaps

=DATE(YEAR(A1),MONTH(A1)+(DAY(A1)>15),LOOKUP(DAY(A1),{1,2,16},{1,15,1}))
 

imdt3000

New Member
Joined
Dec 16, 2010
Messages
6
Thanks Danny but doesn't give me a correct answer. For example in i put 12/27/10 i got 1/13/10. It should be 1/1/11.
I was trying =IF(AND(DAY(B9)>1,DAY(B9)<=15),DATE(YEAR(B9),MONTH(B9),15),DATE(YEAR(B9),MONTH(B9)+1,1)) but only get the date to the 1st but can't get the 15th.
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
So if B9 is 1st or 15th the formula should return the same date? Try this

=IF(DAY(B9-1)<15,B9-DAY(B9)+15,B9+17-DAY(B9+16))
 

Watch MrExcel Video

Forum statistics

Threads
1,123,176
Messages
5,600,146
Members
414,365
Latest member
UUR

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
Top