# Force A Date Lookup in Excel

Wondering if there is a formula to force a specific date to populate in a sell.

We do a planning sheet, and 14 days before an event on a Tuesday documents are due. So if the event were 1/26/2018 the Tuesday of  1/9/2018 the documents are due.
###### Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Finance AnalystCommented:
Assuming you have the event date in lets say cell A2, a formula in another cell =A2-14  would give you the date fourteen days prior.

Going by your description, I don't think you want it that simple though.

Can you be more specific on your criteria?

Event date of 26 Jan (Friday), 2 weeks previous is 12 Jan (Friday), Tuesday of that week is 9 Jan as you've described.

What if event date was 22 Jan (Monday), two weeks previous is 8 Jan (Monday). Do you still want 9 Jan as due date or should that be the previous Tuesday, 2 Jan?

Would it be right to use the rule, round back the event date to the beginning of the week, deduct two weeks and then take Tuesday of that week? If event is before Tuesday roll back 3 weeks.

26 Jan event rolls back to Week Commencing 22 Jan, two weeks prior is 8 Jan, Tuesday is 9 Jan.

22 Jan event is before Tuesday so roll back 3 weeks (1 Jan) and then take Tuesday of that week, 2 Jan.
Finance AnalystCommented:
If that assumption is correct try the following formula:

=IF(WEEKDAY(B3,1)<=3,FLOOR(B3,7)-21+3,CEILING(B3,7)-21+3)

Where event date is B3.

WEEKDAY gives the day of the week, use of the 1 after the date cell tells Excel to number with Sunday being day 1, therefore Tuesday is Day 3; if weekday is less than or equal to 3 ie Tuesday or prior.

FLOOR and CEILING functions work basically the same and round down (FLOOR) or up (CEILING) by the specified factor, in this case 7. Excel stores dates as a serial number with serial number 1 being 1 Jan 1900 which was a Sunday. Rounding a date up or down to a factor of 7 will therefore produce a Saturday date. Adding 3 to that date then gives the following Tuesday.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

AGMAuthor Commented:
Thank you so much!
Finance AnalystCommented: