#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Weekend

I have a list of dates in column A and would like to populate column B with
either 1 or Y is the date is a sat or a sun.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Weekend

Try this

=IF(WEEKDAY(A1)=1,"Y","")

Drag down

Mike

"The Rook" wrote:

I have a list of dates in column A and would like to populate column B with
either 1 or Y is the date is a sat or a sun.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Weekend

try
=IF(OR(WEEKDAY(a2)={1,7}),1,2)
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column B with
either 1 or Y is the date is a sat or a sun.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Weekend

Thanks for that, but how do I pick up saturdays?

Regards


"Mike H" wrote:

Try this

=IF(WEEKDAY(A1)=1,"Y","")

Drag down

Mike

"The Rook" wrote:

I have a list of dates in column A and would like to populate column B with
either 1 or Y is the date is a sat or a sun.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Weekend

Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column B with
either 1 or Y is the date is a sat or a sun.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Weekend

More compact, but much less obvious<g...

=IF(MOD(A1,7)<2,"Y","")

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column B
with
either 1 or Y is the date is a sat or a sun.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Weekend

One mo
=IF(WEEKDAY(A1,2)5,"Y","")

And another:
=IF(WEEKDAY(A1,2)<6,"","Y")



The Rook wrote:

I have a list of dates in column A and would like to populate column B with
either 1 or Y is the date is a sat or a sun.


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Weekend

This will have problems if the 1904 date system is being used (Mac users and
weird Wintel users <vbg).

"Rick Rothstein (MVP - VB)" wrote:

More compact, but much less obvious<g...

=IF(MOD(A1,7)<2,"Y","")

Rick

"Rick Rothstein (MVP - VB)" wrote in
message ...
Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column B
with
either 1 or Y is the date is a sat or a sun.



--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Weekend

I was under the impression that the only difference between the "normal"
Excel date system and the 1904 date system was in the first 4 years (because
the "normal" system improperly considered 1900 as a non-leap year) and,
after that, they were in complete agreement; and, from 1904 on, the VB
serial dates matched the Excel worksheet serial dates. I was also under the
impression that the underlying serial date calculations for Mac and PC were
both the same. If that is the case, then the MOD formula should work (from
1904 onward). Am I wrong in my understandings of this?

Rick


"Dave Peterson" wrote in message
...
This will have problems if the 1904 date system is being used (Mac users
and
weird Wintel users <vbg).

"Rick Rothstein (MVP - VB)" wrote:

More compact, but much less obvious<g...

=IF(MOD(A1,7)<2,"Y","")

Rick

"Rick Rothstein (MVP - VB)" wrote
in
message ...
Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column B
with
either 1 or Y is the date is a sat or a sun.


--

Dave Peterson


  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Weekend

Today (11 Jun 08) is 39610 in the 1900 system, and 38148 in the 1904 system.
MOD(...,7) gives 4 and 5 respectively.
The correction term between the 2 systems is 1462, and MOD(1462,7) gives 6.
--
David Biddulph

"Rick Rothstein (MVP - VB)" wrote in
message ...
I was under the impression that the only difference between the "normal"
Excel date system and the 1904 date system was in the first 4 years
(because the "normal" system improperly considered 1900 as a non-leap year)
and, after that, they were in complete agreement; and, from 1904 on, the VB
serial dates matched the Excel worksheet serial dates. I was also under the
impression that the underlying serial date calculations for Mac and PC were
both the same. If that is the case, then the MOD formula should work (from
1904 onward). Am I wrong in my understandings of this?

Rick


"Dave Peterson" wrote in message
...
This will have problems if the 1904 date system is being used (Mac users
and
weird Wintel users <vbg).

"Rick Rothstein (MVP - VB)" wrote:

More compact, but much less obvious<g...

=IF(MOD(A1,7)<2,"Y","")

Rick

"Rick Rothstein (MVP - VB)" wrote
in
message ...
Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column B
with
either 1 or Y is the date is a sat or a sun.


--

Dave Peterson






  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Weekend

I think so.

If you type 1 into a cell and you're using the 1900 date system, format it as a
date, you'll see:
01/01/1900 (a Sunday)

Change to the 1904 date system and the value of the cell is still one, but
you'll see:
01/02/1904 (a Saturday)

And that's enough to screw up the mod() stuff.


"Rick Rothstein (MVP - VB)" wrote:

I was under the impression that the only difference between the "normal"
Excel date system and the 1904 date system was in the first 4 years (because
the "normal" system improperly considered 1900 as a non-leap year) and,
after that, they were in complete agreement; and, from 1904 on, the VB
serial dates matched the Excel worksheet serial dates. I was also under the
impression that the underlying serial date calculations for Mac and PC were
both the same. If that is the case, then the MOD formula should work (from
1904 onward). Am I wrong in my understandings of this?

Rick

"Dave Peterson" wrote in message
...
This will have problems if the 1904 date system is being used (Mac users
and
weird Wintel users <vbg).

"Rick Rothstein (MVP - VB)" wrote:

More compact, but much less obvious<g...

=IF(MOD(A1,7)<2,"Y","")

Rick

"Rick Rothstein (MVP - VB)" wrote
in
message ...
Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column B
with
either 1 or Y is the date is a sat or a sun.


--

Dave Peterson


--

Dave Peterson
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Weekend

I guess it shows that I have never used the 1904 system.<g I see now... the
values for "date zero" in the two systems differ. Thanks for pointing this
out for me.

Rick



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
Today (11 Jun 08) is 39610 in the 1900 system, and 38148 in the 1904
system. MOD(...,7) gives 4 and 5 respectively.
The correction term between the 2 systems is 1462, and MOD(1462,7) gives
6.
--
David Biddulph

"Rick Rothstein (MVP - VB)" wrote in
message ...
I was under the impression that the only difference between the "normal"
Excel date system and the 1904 date system was in the first 4 years
(because the "normal" system improperly considered 1900 as a non-leap
year) and, after that, they were in complete agreement; and, from 1904 on,
the VB serial dates matched the Excel worksheet serial dates. I was also
under the impression that the underlying serial date calculations for Mac
and PC were both the same. If that is the case, then the MOD formula
should work (from 1904 onward). Am I wrong in my understandings of this?

Rick


"Dave Peterson" wrote in message
...
This will have problems if the 1904 date system is being used (Mac users
and
weird Wintel users <vbg).

"Rick Rothstein (MVP - VB)" wrote:

More compact, but much less obvious<g...

=IF(MOD(A1,7)<2,"Y","")

Rick

"Rick Rothstein (MVP - VB)" wrote
in
message ...
Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column
B
with
either 1 or Y is the date is a sat or a sun.


--

Dave Peterson





  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Weekend

Yes, I saw David's post and now I understand that I didn't understand
before.<g

We could patch the MOD version like this...

=IF(MOD(A1-(DATE(1904,1,1)=0),7)<2,"Y","")

and I think it will work correctly in both systems... but, of course, it is
no longer more compact than the WEEKDAY version and, as such, not as
interesting any more.

Rick


"Dave Peterson" wrote in message
...
I think so.

If you type 1 into a cell and you're using the 1900 date system, format it
as a
date, you'll see:
01/01/1900 (a Sunday)

Change to the 1904 date system and the value of the cell is still one, but
you'll see:
01/02/1904 (a Saturday)

And that's enough to screw up the mod() stuff.


"Rick Rothstein (MVP - VB)" wrote:

I was under the impression that the only difference between the "normal"
Excel date system and the 1904 date system was in the first 4 years
(because
the "normal" system improperly considered 1900 as a non-leap year) and,
after that, they were in complete agreement; and, from 1904 on, the VB
serial dates matched the Excel worksheet serial dates. I was also under
the
impression that the underlying serial date calculations for Mac and PC
were
both the same. If that is the case, then the MOD formula should work
(from
1904 onward). Am I wrong in my understandings of this?

Rick

"Dave Peterson" wrote in message
...
This will have problems if the 1904 date system is being used (Mac
users
and
weird Wintel users <vbg).

"Rick Rothstein (MVP - VB)" wrote:

More compact, but much less obvious<g...

=IF(MOD(A1,7)<2,"Y","")

Rick

"Rick Rothstein (MVP - VB)"
wrote
in
message ...
Give this a try...

=IF(WEEKDAY(A1,3)4,"Y","")

Rick


"The Rook" wrote in message
...
I have a list of dates in column A and would like to populate column
B
with
either 1 or Y is the date is a sat or a sun.


--

Dave Peterson


--

Dave Peterson


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
how I exclude weekend dates Edward Chenderes Setting up and Configuration of Excel 2 March 2nd 21 04:58 PM
Weekend Pass Codes Excel Worksheet Functions 2 June 4th 07 09:02 PM
add days without adding weekend brian thompson3001 via OfficeKB.com New Users to Excel 11 March 8th 06 05:02 PM
Last weekend of month Jeremy Excel Worksheet Functions 5 April 24th 05 03:41 AM
Weekend days other than Sat Sun rkk Excel Worksheet Functions 15 January 25th 05 02:31 AM


All times are GMT +1. The time now is 03:09 AM.

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"