How to compute date of next weekday?

C

curiousgeorge408

Suppose D3 contains some date (e.g. 7/11/2008).

What's the "best" way to compute the date of the next weekday
(7/14/2008)?

Currently, I am using the following array formula:

=MIN( IF( WEEKDAY(D3+ROW($1:$3), 2) <= 5, D3+ROW($1:$3) ) )

It works fine. But is there a better formula?

I would prefer a non-array formula.

PS: I am using Excel 2003.
 
R

Ron Rosenfeld

Suppose D3 contains some date (e.g. 7/11/2008).

What's the "best" way to compute the date of the next weekday
(7/14/2008)?

Currently, I am using the following array formula:

=MIN( IF( WEEKDAY(D3+ROW($1:$3), 2) <= 5, D3+ROW($1:$3) ) )

It works fine. But is there a better formula?

I would prefer a non-array formula.

PS: I am using Excel 2003.

If you have the Analysis Tool Pak installed, you can use:

=WORKDAY(A1,1)

For instructions on how to install the ATP, see HELP for the WORKDAY function.
--ron
 
C

curiousgeorge408

=WORKDAY(A1,1)

Klunk! I thought something like that existed. But when I didn't see
it in the See Also list for WEEKDAY, I gave up. Sigh, I shoulda
looked at the complete Data and Time Functions list.

Thanks.
 
R

Ron Rosenfeld

Klunk! I thought something like that existed. But when I didn't see
it in the See Also list for WEEKDAY, I gave up. Sigh, I shoulda
looked at the complete Data and Time Functions list.

Thanks.

Glad to help. Thanks for the feedback.
--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