Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Nan Nan is offline
external usenet poster
 
Posts: 23
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 266
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Nan Nan is offline
external usenet poster
 
Posts: 23
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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



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
Difference (weekdays) between two dates ant1983 Excel Worksheet Functions 5 October 29th 07 08:37 PM
dates for weekdays in non-contiguous cells spence Excel Worksheet Functions 1 June 10th 07 07:39 PM
How to generate a random list of weekDAYS between two dates? Yanzel Muniz Excel Worksheet Functions 1 September 22nd 05 12:45 AM
How do i count number of weekdays between two dates? Sanjay Shah Excel Worksheet Functions 1 April 4th 05 04:40 PM
Fill dates with weekdays/workdays only DJ Bjorklund Excel Worksheet Functions 1 January 18th 05 04:48 PM


All times are GMT +1. The time now is 12:16 AM.

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

About Us

"It's about Microsoft Excel"