Date Functions
- today() and now() are dynamic
- CTRL-; is static
- datedif
- This appears to be a new function
- It computes the number of months, days or years between two dates.
- It takes a start time.
- An end time.
- A format code.
- y returns the years between two dates.
- m returns the months between the two dates.
- d returns the days between the two dates.
- "md" ignore the years and months, just finds the difference in days. See note below.
- "ym" Ignore days and years, just find month difference.
- "yd" ignore years
- In documentation it says that "MD" is used.
- How many days/months/years old are you?
- Graduation is 5/2/20, how many days?
- Fall Graduation is 12/12/2020 how many days?
- Next spring graduation is 5/1/2021 how many days? Months?
- Parsing a date
- =year(date) returns the year.
- =month(date) returns the month
- =day(date) returns the day
- =weekday(date) returns the day number, 1-sunday
- But you can shift this if you wish =weekday(date,shift)
- =date(year, month, day) will convert the three number value to a date serial number.
- There are others, but these will do.
- Here is a made up list of birthdays.
- How old is everyone?
- What day and month was each person born.
- Without filtering, can you find how many people share your birthday without the year?
- How long to their next birthday?
- Excel is unhappy that the date was generated without the year. Do we have any potential problems?
- Click and see how excel wants to adjust this.
- Cany you generate a better date?