Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Joe Joe is offline
external usenet poster
 
Posts: 476
Default Populate days of the month in a column by checking on date

Is it possible to populate a column with the days of any given month by
checking on a cell reference to a date?

For example if A1 contained 2/28/2009 is there a way for the system
to populate B1 through B28 with the dates of the month? Then if you changed
A1 to 3/31/2009 have it populate B1 through B31 with the dates for March?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Populate days of the month in a column by checking on date

Try this...

A1 = any date

Enter this formula in A2:

=A1-DAY(A1)+1

Enter this formula in A3 and copy down to A32:

=IF(DAY(IF(A2="",0,A2)+1)DAY(A$2),A2+1,"")

Format A2:A32 as Date

If A1 is empty the dates returned will be for January 1900.

--
Biff
Microsoft Excel MVP


"Joe" wrote in message
...
Is it possible to populate a column with the days of any given month by
checking on a cell reference to a date?

For example if A1 contained 2/28/2009 is there a way for the system
to populate B1 through B28 with the dates of the month? Then if you
changed
A1 to 3/31/2009 have it populate B1 through B31 with the dates for March?




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Populate days of the month in a column by checking on date

Ooops!

I put the formulas in the wrong locations! You wanted the results in B1:B31.

Ok.

Enter this formula in B1:

=A1-DAY(A1)+1

Enter this formula in B2 and copy down to B31:

=IF(DAY(IF(B1="",0,B1)+1)DAY(B$1),B1+1,"")

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try this...

A1 = any date

Enter this formula in A2:

=A1-DAY(A1)+1

Enter this formula in A3 and copy down to A32:

=IF(DAY(IF(A2="",0,A2)+1)DAY(A$2),A2+1,"")

Format A2:A32 as Date

If A1 is empty the dates returned will be for January 1900.

--
Biff
Microsoft Excel MVP


"Joe" wrote in message
...
Is it possible to populate a column with the days of any given month by
checking on a cell reference to a date?

For example if A1 contained 2/28/2009 is there a way for the system
to populate B1 through B28 with the dates of the month? Then if you
changed
A1 to 3/31/2009 have it populate B1 through B31 with the dates for March?






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Joe Joe is offline
external usenet poster
 
Posts: 476
Default Populate days of the month in a column by checking on date

Now that is really cool!

"T. Valko" wrote:

Ooops!

I put the formulas in the wrong locations! You wanted the results in B1:B31.

Ok.

Enter this formula in B1:

=A1-DAY(A1)+1

Enter this formula in B2 and copy down to B31:

=IF(DAY(IF(B1="",0,B1)+1)DAY(B$1),B1+1,"")

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try this...

A1 = any date

Enter this formula in A2:

=A1-DAY(A1)+1

Enter this formula in A3 and copy down to A32:

=IF(DAY(IF(A2="",0,A2)+1)DAY(A$2),A2+1,"")

Format A2:A32 as Date

If A1 is empty the dates returned will be for January 1900.

--
Biff
Microsoft Excel MVP


"Joe" wrote in message
...
Is it possible to populate a column with the days of any given month by
checking on a cell reference to a date?

For example if A1 contained 2/28/2009 is there a way for the system
to populate B1 through B28 with the dates of the month? Then if you
changed
A1 to 3/31/2009 have it populate B1 through B31 with the dates for March?







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Populate days of the month in a column by checking on date

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Joe" wrote in message
...
Now that is really cool!

"T. Valko" wrote:

Ooops!

I put the formulas in the wrong locations! You wanted the results in
B1:B31.

Ok.

Enter this formula in B1:

=A1-DAY(A1)+1

Enter this formula in B2 and copy down to B31:

=IF(DAY(IF(B1="",0,B1)+1)DAY(B$1),B1+1,"")

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try this...

A1 = any date

Enter this formula in A2:

=A1-DAY(A1)+1

Enter this formula in A3 and copy down to A32:

=IF(DAY(IF(A2="",0,A2)+1)DAY(A$2),A2+1,"")

Format A2:A32 as Date

If A1 is empty the dates returned will be for January 1900.

--
Biff
Microsoft Excel MVP


"Joe" wrote in message
...
Is it possible to populate a column with the days of any given month
by
checking on a cell reference to a date?

For example if A1 contained 2/28/2009 is there a way for the system
to populate B1 through B28 with the dates of the month? Then if you
changed
A1 to 3/31/2009 have it populate B1 through B31 with the dates for
March?









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
# of days in that month for a selected date Narnimar Excel Discussion (Misc queries) 9 September 19th 08 09:20 AM
How to calculate a date: first day of the month after 60 days Claudia Excel Discussion (Misc queries) 12 June 28th 07 05:10 AM
Date glitch? First 12 days of month format differently than the r yakalo Excel Discussion (Misc queries) 3 April 9th 07 01:18 AM
Fomula for number of days on each month from a date range [email protected] Excel Discussion (Misc queries) 3 November 9th 06 03:08 AM
If data in one column, take date, add 2 days, and turn the entire column a color... [email protected] Excel Discussion (Misc queries) 6 August 24th 06 03:58 AM


All times are GMT +1. The time now is 11:41 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"