# Rounding to the following Sunday

#### SPOATO

##### New Member
Racking my brain to get the following to work: =IFERROR(IF(D5=0,"",D5+45),IF(D5="","",D5+7-MOD(D5-1,7)))

D5 being the source date that I'm adding 45 days to and then rounding to the following Sunday. Honestly wouldn't mind figuring out the previous Sunday as well. We are trying to set ordering dates to Sunday to help with Monday through Friday scheduling. I've been using Numbers iOS/Mac for the past 2-3 years so my Excel is very rusty. Any help is GREATLY appreciated.

### Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

#### geo77

##### New Member
Spoato, assuming that the date is in cell [D5] try this:

=D5-WEEKDAY(D5) - truncated to the previous Sunday

=D5+7-WEEKDAY(D5) - rounded to the next Sunday

The fun starts here: http://www.excelunusual.com

Last edited:

#### SPOATO

##### New Member
Spoato, assuming that the date is in cell [D5] try this:

=D5-WEEKDAY(D5) - truncated to the previous Sunday

=D5+7-WEEKDAY(D5) - rounded to the next Sunday

The fun starts here: http://www.excelunusual.com

Thx,geo77

As a single statement it works perfectly. I keep getting errors when changing the second statement from current formula. I need both to run in order, but as shown will only process the first statement.

Replies
10
Views
281
Replies
9
Views
422
Replies
3
Views
787
Replies
4
Views
213
Replies
0
Views
1K

1,186,875
Messages
5,960,370
Members
438,472
Latest member
Nate J

### 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.

### Which adblocker are you using?

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

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