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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 09:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com