#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Weekends

I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.

Thanks in advance.

bob



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Weekends

Perhaps this?

F1: =F9+CHOOSE(WEEKDAY(F9,2),0,0,0,0,0,2,1)-7

But....if you have the Analysis ToolPak add-in installed:
F1: =WORKDAY(F9,-5)

Does that help?
----------------------
Regards,

Ron
Microsoft MVP (Excel)


"Bob" wrote in message
...
I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.

Thanks in advance.

bob




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Weekends

One way

=IF(WEEKDAY(F9,2)5,F9-MOD(F9+5,7),F9-7)



--
Regards,

Peo Sjoblom



"Bob" wrote in message
...
I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.

Thanks in advance.

bob




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Weekends

=F9-7+2*(WEEKDAY(F9)=6)+(WEEKDAY(F9)=7)

HTH
Kostis Vezerides

On Jun 7, 7:03 pm, "Bob" wrote:
I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.

Thanks in advance.

bob



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Weekends

On 7 Jun, 12:03, "Bob" wrote:
I am trying to set up a function that will check the following

I am using Excel XP Pro

Bob,

I'd probably do it this way

=IF(WEEKDAY(F1,2)=6,F1+8-WEEKDAY(F1,2),F1)

HTH,
Barb Reinhardt

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.

Thanks in advance.

bob





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Weekends

Thanks for the info

Works perfect

"Ron Coderre" wrote in message
...
Perhaps this?

F1: =F9+CHOOSE(WEEKDAY(F9,2),0,0,0,0,0,2,1)-7

But....if you have the Analysis ToolPak add-in installed:
F1: =WORKDAY(F9,-5)

Does that help?
----------------------
Regards,

Ron
Microsoft MVP (Excel)


"Bob" wrote in message
...
I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.

Thanks in advance.

bob






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Weekends

I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.


While I recognize conciseness in a formula is not the ultimate goal,
especially if it impacts readability, I decided, as a personal exercise
only, to see what the most concise formula I could come up with to do what
you asked. Now, I don't recommend you use this in production as its purpose
cannot be easily discerned by looking at it (and besides, you already have a
few really good formulas to chose from that others have already posted); but
I managed to create two formulas that both do what you asked, each composed
of a total of 33 keystrokes (including the equal sign)... I don't think a
more concise formula exists (remember now, I did this strictly as a personal
challenge exercise; however, I figured others might find them interesting
also). Anyway, with all of that said, here are the two formulas I found...

=F9+7+(2-MOD(F9,7))*(MOD(F9,7)<2)

=F9+7+(MOD(F9,7)<2)+(MOD(F9,7)=0)

Rick

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Weekends

"Peo Sjoblom" wrote...
One way

=IF(WEEKDAY(F9,2)5,F9-MOD(F9+5,7),F9-7)

....

Only works in the 1900 date system.

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Weekends

On Fri, 8 Jun 2007 00:49:59 -0400, "Rick Rothstein \(MVP - VB\)"
wrote:

I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.


While I recognize conciseness in a formula is not the ultimate goal,
especially if it impacts readability, I decided, as a personal exercise
only, to see what the most concise formula I could come up with to do what
you asked. Now, I don't recommend you use this in production as its purpose
cannot be easily discerned by looking at it (and besides, you already have a
few really good formulas to chose from that others have already posted); but
I managed to create two formulas that both do what you asked, each composed
of a total of 33 keystrokes (including the equal sign)... I don't think a
more concise formula exists (remember now, I did this strictly as a personal
challenge exercise; however, I figured others might find them interesting
also). Anyway, with all of that said, here are the two formulas I found...

=F9+7+(2-MOD(F9,7))*(MOD(F9,7)<2)

=F9+7+(MOD(F9,7)<2)+(MOD(F9,7)=0)

Rick


Well, if you have Excel 2007, or if you have the ATP installed, you could use:

=WORKDAY(F1+6,1)
--ron
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Weekends

On Fri, 8 Jun 2007 00:49:59 -0400, "Rick Rothstein \(MVP - VB\)"
wrote:

I am trying to set up a function that will check the following

I am using Excel XP Pro

I have a date in cell F9. It places a date in F1 that will be 7 days
earlier. (This works fine)

Question:
If the date in F1 is a Saturday or Sunday, I need it to put the date of
Monday in that cell.

Does any one know the formula for this.


While I recognize conciseness in a formula is not the ultimate goal,
especially if it impacts readability, I decided, as a personal exercise
only, to see what the most concise formula I could come up with to do what
you asked. Now, I don't recommend you use this in production as its purpose
cannot be easily discerned by looking at it (and besides, you already have a
few really good formulas to chose from that others have already posted); but
I managed to create two formulas that both do what you asked, each composed
of a total of 33 keystrokes (including the equal sign)... I don't think a
more concise formula exists (remember now, I did this strictly as a personal
challenge exercise; however, I figured others might find them interesting
also). Anyway, with all of that said, here are the two formulas I found...

=F9+7+(2-MOD(F9,7))*(MOD(F9,7)<2)

=F9+7+(MOD(F9,7)<2)+(MOD(F9,7)=0)

Rick


Misread:

Should be:

=WORKDAY(F1-8,1)
--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear list from weekends Arne Hegefors Excel Worksheet Functions 4 January 22nd 07 02:59 PM
removing weekends Dean Excel Worksheet Functions 6 July 21st 06 09:08 PM
WEEKENDS VS. WEEKDAYS TLAngelo Excel Discussion (Misc queries) 0 July 10th 06 06:49 PM
WEEKENDS VS. WEEKDAYS TLAngelo Excel Discussion (Misc queries) 7 May 12th 06 05:31 PM
How do I set up a calculation to exclude weekends? Ken Proj mgr Excel Worksheet Functions 6 February 8th 06 02:49 PM


All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"