Find 1st friday after a varible date

  • Thread starter Thread starter GitarJake
  • Start date Start date
G

GitarJake

Hello all,

How do you find the 1st Friday after a variable date?

TIA,

Jake
 
DateAdd("d", 7 - DatePart("w", varDateVariable, vbSaturday),
varDateVariable)
 
DatePart("w", varDateVariable, vbSaturday) returns a number corresponding to
the day of the week. By specifying vbSaturday as the 3rd argument, it will
return 1 for Saturdays, 2 for Sundays, 3 for Mondays and so on up to 7 for
Fridays.

By subtracting that value from 7, therefore, you know how many days it is
until the next Friday, so you add that many days to your date.
 
Hi Again Ken,

This works great! Do you mind explaining it to me a little?

Thanks again,

Jake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

16 or 32GB Laptop? 10
Excel Date of first friday every month 3
Date problem 3
Excel Message box with days of month & date. 1
VLOOKUP 1st Friday in April and So On 1
Black Friday starts today! 27
Holiday Dates in Footer 3
Date calculation 4

Back
Top