Saturday, February 28, 2015

worksheet function - Date formula in excel regarding calendar


I need to fill in a Day and Date column in an Excel table to create a one month calendar:


Select a year:  2016
Select a month: September
-------------------------
| Day | Date |
|------------------------
|Thursday | 01.09.2016 |
|Friday | 02.09.2016 |
| etc. | etc. |
-------------------------

(Note the date format is dd.mm.yyyy.)


The days and dates must be calculated automatically after choosing year and month.


Answer



You can achieve it with a few simple formulas:



  • Date for first day of the month:
    =DATE(B1,B2,1)

  • Rest of the dates:
    =IFERROR(IF(MONTH(B5)=MONTH(B5+1),B5+1,""),"")

  • Day names:
    =IFERROR(CHOOSE(WEEKDAY(B5,2),"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"),"")


Fill the formulas down to 31 rows, it'll display only dates in the month, cells below will be empty.


enter image description here


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...