ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Round dates to weekdays (https://www.excelbanter.com/excel-worksheet-functions/188422-round-dates-weekdays.html)

Nan

Round dates to weekdays
 
Is there a way that Excel can recognize if a date is a weekend and round it
to the nearest weekday?
--
TIA, Nan

dhstein

Round dates to weekdays
 
Using another cell and assume your date is in A1 --- =IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

"Nan" wrote:

Is there a way that Excel can recognize if a date is a weekend and round it
to the nearest weekday?
--
TIA, Nan


Bob Phillips

Round dates to weekdays
 
=A10+(WEEKDAY(A10,2)5)+(WEEKDAY(A10)6)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Nan" wrote in message
...
Is there a way that Excel can recognize if a date is a weekend and round
it
to the nearest weekday?
--
TIA, Nan




Ron Rosenfeld

Round dates to weekdays
 
On Wed, 21 May 2008 13:12:00 -0700, Nan wrote:

Is there a way that Excel can recognize if a date is a weekend and round it
to the nearest weekday?


One way is to use a formula (with your date in A1):

=A1-(WEEKDAY(A1)=7)+(WEEKDAY(A1)=1)
--ron

T. Valko

Round dates to weekdays
 
One way...

A2 = some date

=A2+CHOOSE(WEEKDAY(A2),1,0,0,0,0,0,-1)

A Saturday date gets reduced to Friday's date and a Sunday date gets
advanced to Monday's date.

--
Biff
Microsoft Excel MVP


"Nan" wrote in message
...
Is there a way that Excel can recognize if a date is a weekend and round
it
to the nearest weekday?
--
TIA, Nan




Nan

Round dates to weekdays
 
Thank you all for your great (and FAST!) replies. I know at least one will
do the trick for me!
--
TIA, Nan


"Nan" wrote:

Is there a way that Excel can recognize if a date is a weekend and round it
to the nearest weekday?
--
TIA, Nan


Rick Rothstein \(MVP - VB\)[_493_]

Round dates to weekdays
 
Maybe a little simpler...

=A1-(MOD(A1,7)=0)+(MOD(A1,7)=1)

Rick


"dhstein" wrote in message
...
Using another cell and assume your date is in A1 --- =IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

"Nan" wrote:

Is there a way that Excel can recognize if a date is a weekend and round
it
to the nearest weekday?
--
TIA, Nan



amy benham

excel rounding to weekdays
 
I have a chart that is based on different formulas for each column. I want to keep the formulas I have and make sure the chart only displays weekdays.

I've found the formula

=IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

But I don't know how to add that to my pre-existing formulas.

my existing formula for all rows in column A is =A#+5
in column B, my formula is =B#+3
etc. Each column is different.

Can you help?




dhstei wrote:

Using another cell and assume your date is in A1 --- =IF
21-May-08

Using another cell and assume your date is in A1 --- =IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

"Nan" wrote:

Previous Posts In This Thread:

On Wednesday, May 21, 2008 4:12 PM
Na wrote:

Round dates to weekdays
Is there a way that Excel can recognize if a date is a weekend and round it
to the nearest weekday?
--
TIA, Nan

On Wednesday, May 21, 2008 4:36 PM
dhstei wrote:

Using another cell and assume your date is in A1 --- =IF
Using another cell and assume your date is in A1 --- =IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

"Nan" wrote:

On Wednesday, May 21, 2008 4:38 PM
Bob Phillips wrote:

=A10+(WEEKDAY(A10,2)5)+(WEEKDAY(A10)6)-- ---HTHBob(there's no email, no
=A10+(WEEKDAY(A10,2)5)+(WEEKDAY(A10)6)

--
---
HTH

Bob


(there is no email, no snail mail, but somewhere should be gmail in my addy)

On Wednesday, May 21, 2008 4:38 PM
Ron Rosenfeld wrote:

Round dates to weekdays
One way is to use a formula (with your date in A1):

=A1-(WEEKDAY(A1)=7)+(WEEKDAY(A1)=1)
--ron

On Wednesday, May 21, 2008 4:48 PM
T. Valko wrote:

One way...
One way...

A2 = some date

=A2+CHOOSE(WEEKDAY(A2),1,0,0,0,0,0,-1)

A Saturday date gets reduced to Friday's date and a Sunday date gets
advanced to Monday's date.

--
Biff
Microsoft Excel MVP

On Wednesday, May 21, 2008 5:14 PM
Na wrote:

Thank you all for your great (and FAST!
Thank you all for your great (and FAST!) replies. I know at least one will
do the trick for me!
--
TIA, Nan


"Nan" wrote:

On Wednesday, May 21, 2008 5:44 PM
Rick Rothstein \(MVP - VB\) wrote:

Maybe a little simpler...
Maybe a little simpler...

=A1-(MOD(A1,7)=0)+(MOD(A1,7)=1)

Rick

EggHeadCafe - Software Developer Portal of Choice
Scriptless ASP Progress Indicator
http://www.eggheadcafe.com/tutorials...rogress-i.aspx

T. Valko

excel rounding to weekdays
 
Not sure what you're doing. Maybe this...

=IF(MOD(A1+5,7)<2,A1+5+2-MOD(A1+5,7),A1+5)

--
Biff
Microsoft Excel MVP


<amy benham wrote in message
...
I have a chart that is based on different formulas for each column. I want
to keep the formulas I have and make sure the chart only displays weekdays.

I've found the formula

=IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

But I don't know how to add that to my pre-existing formulas.

my existing formula for all rows in column A is =A#+5
in column B, my formula is =B#+3
etc. Each column is different.

Can you help?




dhstei wrote:

Using another cell and assume your date is in A1 --- =IF
21-May-08

Using another cell and assume your date is in A1 --- =IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

"Nan" wrote:

Previous Posts In This Thread:

On Wednesday, May 21, 2008 4:12 PM
Na wrote:

Round dates to weekdays
Is there a way that Excel can recognize if a date is a weekend and round
it
to the nearest weekday?
--
TIA, Nan

On Wednesday, May 21, 2008 4:36 PM
dhstei wrote:

Using another cell and assume your date is in A1 --- =IF
Using another cell and assume your date is in A1 --- =IF
(MOD(A1,7)<2,A1+2-MOD(A1,7),A1)

"Nan" wrote:

On Wednesday, May 21, 2008 4:38 PM
Bob Phillips wrote:

=A10+(WEEKDAY(A10,2)5)+(WEEKDAY(A10)6)-- ---HTHBob(there's no email, no
=A10+(WEEKDAY(A10,2)5)+(WEEKDAY(A10)6)

--
---
HTH

Bob


(there is no email, no snail mail, but somewhere should be gmail in my
addy)

On Wednesday, May 21, 2008 4:38 PM
Ron Rosenfeld wrote:

Round dates to weekdays
One way is to use a formula (with your date in A1):

=A1-(WEEKDAY(A1)=7)+(WEEKDAY(A1)=1)
--ron

On Wednesday, May 21, 2008 4:48 PM
T. Valko wrote:

One way...
One way...

A2 = some date

=A2+CHOOSE(WEEKDAY(A2),1,0,0,0,0,0,-1)

A Saturday date gets reduced to Friday's date and a Sunday date gets
advanced to Monday's date.

--
Biff
Microsoft Excel MVP

On Wednesday, May 21, 2008 5:14 PM
Na wrote:

Thank you all for your great (and FAST!
Thank you all for your great (and FAST!) replies. I know at least one
will
do the trick for me!
--
TIA, Nan


"Nan" wrote:

On Wednesday, May 21, 2008 5:44 PM
Rick Rothstein \(MVP - VB\) wrote:

Maybe a little simpler...
Maybe a little simpler...

=A1-(MOD(A1,7)=0)+(MOD(A1,7)=1)

Rick

EggHeadCafe - Software Developer Portal of Choice
Scriptless ASP Progress Indicator
http://www.eggheadcafe.com/tutorials...rogress-i.aspx





All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com