TechJive

“I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living, it’s a way of looking at life through the wrong end of a telescope. Which is what I do, and that enables you to laugh at life’s realities.” - Dr. Seuss

Excel Calendar Trick

This is old news by some measure, but it is a timeless piece of trickery with Excel.

Make a calendar in Excel:

=IF(MONTH(DATE(YEAR(NOW()),MONTH(NOW()),1))
<>MONTH(DATE(YEAR(NOW()),MONTH(NOW()),1)-
(WEEKDAY(DATE(YEAR(NOW()),MONTH(NOW()),1))-1)+
{0;1;2;3;4;5}*7+{1,2,3,4,5,6,7}-1),"",DATE(YEAR(NOW()),
MONTH(NOW()),1)-(WEEKDAY(DATE(YEAR(NOW()),
MONTH(NOW()),1))-1)+{0;1;2;3;4;5}*7+{1,2,3,4,5,6,7}-1)

To use it:

  1. Copy the formula text to the clipboard
  2. Activate an Excel sheet and select a 7-col by 6-row range
  3. Press F2
  4. Press Ctrl+V to paste the formula into the active cell
  5. Press Ctrl+Shift+Enter (to make it a multicell array formula)
  6. Format the cells using the “Date” number format.

Voila! You have a calendar for the current month.

Voila is right.

via SlackerManager

Activity

4 total comments, leave your comment or trackback.
  1. This is very, very good.

    Now, how do you have this formula calculate for the remaining months of the year (not the current month)?

  2. Gates Is, You Know
    Mar 24th 2008

    You know,
    MONTH(DATE(YEAR(NOW()),MONTH(NOW()),1)) is MONTH(NOW())

    and one possible simplification is to define BOM as
    =DATE(YEAR(NOW()),MONTH(NOW()),1)
    and absorbing the “minus 1″ in the formula, giving
    {=IF(
    MONTH(NOW())MONTH(BOM-(WEEKDAY(BOM)-1)+ {0;1;2;3;4;5}*7+{0,1,2,3,4,5,6}),
    “”,
    BOM-(WEEKDAY(BOM)-1)+{0;1;2;3;4;5}*7+{0,1,2,3,4,5,6}
    )}

    Perhaps some will find that more intuitive or instructive.

  3. Gates Is, You Know
    Mar 24th 2008

    There needs to be a less than and greater than sign following NOW() in the comment above - a victim of posting HTML.

  4. It is not working man


Leave a Reply


Search

The archives run deep. Feel free to search older content using topic keywords.