Week End Formula

P

pjd

Hi

Does anyone have a formula for calculating the week end date. ie if I put in 15/06/04 I need the cell to display the week end date, in this case 26/06/04.

Is this possible??
 
P

Peo Sjoblom

Where's the logic in that unless you meant 19/06/04?
One way

=A1+7-MOD(WEEKDAY(A1),8)

with your date in A1,
if indeed you meant 26/06/04
just add 7

=A1+7-MOD(WEEKDAY(A1),8)+7

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)



pjd said:
Hi

Does anyone have a formula for calculating the week end date. ie if I put
in 15/06/04 I need the cell to display the week end date, in this case
26/06/04.
 
R

Ron Rosenfeld

Hi

Does anyone have a formula for calculating the week end date. ie if I put in 15/06/04 I need the cell to display the week end date, in this case 26/06/04.

Is this possible??

What is your definition of Weekend?

In your example, 15 June is a Tuesday; and 26 June is two Saturdays hence.

Here in the US we would ordinarily consider the next weekend to be the next
Saturday.

In any event, for the first Saturday after any date:

=A5+7-WEEKDAY(A5)

For the second Saturday:

=A5+14-WEEKDAY(A5)

If the initial date is a Saturday, the first formula will return the same date.
That behavior can be altered if you wish.



--ron
 
R

Ron Rosenfeld

Where's the logic in that unless you meant 19/06/04?
One way

=A1+7-MOD(WEEKDAY(A1),8)

with your date in A1,
if indeed you meant 26/06/04
just add 7

=A1+7-MOD(WEEKDAY(A1),8)+7


Peo,

What is the purpose of the MOD function in your formula?

I seem to get the same result using just WEEKDAY(A1).


--ron
 

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

Top