Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default just weekdays

Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default just weekdays

Try this formula, which will work if there is a weekday in A1.
Just put this formula in B1 and copy and paste to the right.

=IF(WEEKDAY(A1+1) = 7, A1+3, IF(WEEKDAY(A1+1) = 1, A1+2, A1+1))

RBS

"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default just weekdays

No need to check for Sunday, the Saturday check will skip it

=C2+1+(WEEKDAY(C2)=6)*2

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default just weekdays

Yes, that is a bit neater.

RBS

"Bob Phillips" wrote in message
...
No need to check for Sunday, the Saturday check will skip it

=C2+1+(WEEKDAY(C2)=6)*2

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default just weekdays

One way:

=C2+1+IF(WEEKDAY(C2+1)=1,1,0)+IF(WEEKDAY(C2+1)=7,2 ,0)

Or you could use the WORKDAY function

=WORKDAY(C2,1) which gives the flexibility to ignore Bank Holidays, etc

Regards

Trevor


"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default just weekdays

but Trevor, isn´t it so, that WORKDAY isn´t a standard function of
excel?

chears
//Peter
Trevor Shuttleworth skrev:

One way:

=C2+1+IF(WEEKDAY(C2+1)=1,1,0)+IF(WEEKDAY(C2+1)=7,2 ,0)

Or you could use the WORKDAY function

=WORKDAY(C2,1) which gives the flexibility to ignore Bank Holidays, etc

Regards

Trevor


"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default just weekdays

dear Bob
can you explain that a little bit more ps?

No need to check for Sunday, the Saturday check will skip it

=C2+1+(WEEKDAY(C2)=6)*2

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default just weekdays

It is part of the Analysis Toolpak ... which I'm sure is a standard option.

Select Tools | Add-Ins... and select Analysis Toolpak from the available
options

Regards

Trevor


"peter the swede" wrote in message
oups.com...
but Trevor, isn´t it so, that WORKDAY isn´t a standard function of
excel?

chears
//Peter
Trevor Shuttleworth skrev:

One way:

=C2+1+IF(WEEKDAY(C2+1)=1,1,0)+IF(WEEKDAY(C2+1)=7,2 ,0)

Or you could use the WORKDAY function

=WORKDAY(C2,1) which gives the flexibility to ignore Bank Holidays, etc

Regards

Trevor


"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default just weekdays

Loading the Toolpak

http://office.microsoft.com/en-us/as...277241033.aspx

http://www.cpearson.com/excel/ATP.htm

Regards

Trevor


"peter the swede" wrote in message
oups.com...
but Trevor, isn´t it so, that WORKDAY isn´t a standard function of
excel?

chears
//Peter
Trevor Shuttleworth skrev:

One way:

=C2+1+IF(WEEKDAY(C2+1)=1,1,0)+IF(WEEKDAY(C2+1)=7,2 ,0)

Or you could use the WORKDAY function

=WORKDAY(C2,1) which gives the flexibility to ignore Bank Holidays, etc

Regards

Trevor


"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default just weekdays

Sure, it is quite straightforward.

The easy bit

=C2+1 - advance the date one day

test if the date is a Friday

WEEKDAY(C2)=6

which returns a TRUE or FALSE, which when multiplied by 2 gives 2 or 0, so
on a Friday another 2 days gets added, any other day, 0 days get added.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"peter the swede" wrote in message
oups.com...
dear Bob
can you explain that a little bit more ps?

No need to check for Sunday, the Saturday check will skip it

=C2+1+(WEEKDAY(C2)=6)*2

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"peter the swede" wrote in message
oups.com...
Hi all
on a spreedsheet I´ve a series with dates, where from previous date 1
day is added (i.e. C3=C2+1).
Now I wan´t to do the following:
1) check if C10 is a saturday?
2) if C10 is saturday than go to monday
3) check if C10 is sunday ?
4) if yes then add 1 day
5) if C10 is not sunday, than add 1 day

I hope you understand what I want to do

Thanks in advance
//Peter




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
SUM/ Count Only weekdays Scott Kieta[_2_] Excel Worksheet Functions 2 November 3rd 08 06:52 PM
Weekdays Kerryn Excel Discussion (Misc queries) 7 July 5th 08 01:56 AM
Weekdays only! rexmann Excel Discussion (Misc queries) 2 August 14th 07 02:52 PM
Weekdays Jeff Excel Discussion (Misc queries) 7 February 15th 05 12:18 AM
calculate weekdays only Tom Ogilvy Excel Programming 0 September 21st 04 10:19 PM


All times are GMT +1. The time now is 09:05 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"