List Days of Month

  • Thread starter Thread starter Sat
  • Start date Start date
S

Sat

I am writing a 24/7 roster. I want to automatically fill
up cells to consist the days of a month I choose from a
list.
eg. If I choose Jan 2004 from a list in cell B4, than I
want cells D1 to D31 to fillup with the days of that month
in the format dd-mmm-yy. What formula can I use.

Sat
 
Hi "Sat"

Assuming B4 is a date and not text:

D1:
=B4
D2:D31
=IF(D1="","",IF(D1=DATE(YEAR(D1),MONTH(D1)+1,0),"",D1+1))

You'll find that if B4 is Feb-2004 the formula will stop after Feb-29

Note the use of the Excel feature that the 0th of a month is the last
day of the preceding month.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
If B4 is really 1/1/2004 (which it probably is), put this
in D1:

=B4

and put this in D2 and fill down:

=IF(D1="","",IF(MONTH(D1+1)<>MONTH($B$4),"",D1+1))

Select D1:D31 and press Ctrl+1, and format as desired.

HTH
Jason
Atlanta, GA
 
Back
Top