If week begins with monday, then, if week begins on tuesday then...

emoandy05

Board Regular
Joined
Sep 4, 2013
Messages
60
Hello!

Looking for a formula or VBA to help with this.

In column L I have a list of dates in order but some dates might be missing (ex. 12/11/15, 12/12/15, 12/14/15). If a date is a Monday followed by a date that is a Tuesday, then 250 needs to go in each adjacent cell for Monday and Tuesday in column X. If a date is not a Monday, and the next date is a Tuesday is followed by a date that is a Wednesday, then 250 needs to go in each adjacent cell for Tuesday and Wednesday in column X.

Ex. 1
A B
12/13/15
12/14/15 250
12/15/15 250
12/16/16

Ex. 2
A B
1/17/16
1/19/16 250
1/20/16 250
1/21/16

Thank you!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
change all cell references as needed

Code:
=IF(AND(TEXT(J44,"dddd")="Monday",TEXT(J45,"dddd")="Tuesday"),250,IF(AND(TEXT(J44,"dddd")="Tuesday",OR(TEXT(J43,"dddd")="Monday",TEXT(J45,"dddd")="Wednesday")),250,IF(AND(TEXT(J44,"dddd")="Wednesday",TEXT(J43,"dddd")="Tuesday"),250,"")))

rich
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,331
Members
449,077
Latest member
jmsotelo

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