Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SUM/ Count Only weekdays | Excel Worksheet Functions | |||
Weekdays | Excel Discussion (Misc queries) | |||
Weekdays only! | Excel Discussion (Misc queries) | |||
Weekdays | Excel Discussion (Misc queries) | |||
calculate weekdays only | Excel Programming |