Tuesday, December 13, 2011

Dates and Date Functions in Microsoft Office Excel



Microsoft Office Excel stores dates as numbers are called serial numbers or serial values ​​and dates can be displayed (formatted) in different ways. Since the numbers, dates can be sorted and used in calculations, and there are several Excel worksheet functions that can be used with dates. This article explains the date, date format and date functions in Excel, and includes a few tips on using the fill.

Excel supports two date systems. 1900 date system is the default on computers running Windows operating systems, and the earliest date (serial value 1) in this system is 1 January 1900.1904 date system by default on Apple Mac in which the date serial number 1 is January 2 1904.Datumski system can modify the Excel Options, but it is not necessary, because Excel automatically adjusts the date, if the file was created in Excel for Windows opened on a Mac or vice versa.

There is an error in the date system 1900th Excel 1900 is considered to be a leap year, but it's not, so it is 29 February 1900 in Excel for Windows. This means weekdays are shown for dates from 1 February to 29th 1900, and calculations using dates before March 1, 1900 of the day. It probably will not bother you, but keep in mind.

when the date entered in a cell with two digits of the year, for example, 9/5/11, Excel interprets the century. If age 00-29 Excel assumes that in 2000, do the 2029th If the years 30 through 99 Excel assumes that the 1930 to 1999. It can be more drive-by entering dates with four digit year, eg 1911/09/05.Način Excel interprets the century can be changed in Control Panel, Regional and Language Options, Regional Options, and click the Customize button, then select Date Table

The cells can be modeled to display the date in different ways by right-clicking a cell, selecting Format Cells from the pop-up menu and then selecting the Date tab Broj.Datum formats can be selected in the "Type" field specifies the country selected in Control Panel, Regional and language Options, but can be over-ridden by changing the "Local (location:)" field in the Format Cells dialog box, for example, from English (Australia) to English (U.S. ).

For example, if 9/5/11 is entered in a cell in the English (Australia) format (where the dates are shown as day, month, year) it could be formatted as 9/5/11, 9 / 05/2011, 09-May-11, or Monday, the 9th May, 2011. In the U.S., where the month, day, year format is used, the same day entered as 09/05/11 could be formatted as 05/09/11, 09/05/2011, 9 May, 2011, or 9-May-2011. Alternatively, the date may appear as a number of cell formatting as number no decimal places (May 5, 2011 as a serial number value of 40 672 in Excel for Windows ).

Dates can also be customized format. For example, the above date custom designed to "ddd" will appear in the cell as the Mon or the custom formatted as "dddd" to be presented as Monday. It could also be adapted formatted as "mmm" to view the May or as "mmmm, yyyy" to view May 2011.

following the date the (each shown with syntax and a brief explanation) can be used in Excel. It might be easier to follow the examples below to the list, so to start with a new (empty) list, enter 2011 in cell A1, 5 in cell A2 and 9 in cell A3 - and when you copy the formula below, make sure you copy the the = sign of the last closed zagrada.Datum standard values ​​listed below apply to Excel for Windows. The 1904 date system on the Mac will be different.

Date (year, month, day) returns the serial number that represents a date. For example, copy the formula = DATE (A1, A2, A3) and paste it into cell A4 on the example list. It will return to 40,672, as a serial value for 5 May 2011 and that date will be displayed in the default date format to the cell.

The numbers and nesting may be involved in this function to add a number of years, months or days of the date. Copy = DATE (YEAR (A4), month (A4) 18, DAY (A4 )) in cell A5 on the worksheet. It will add 18 months to date in cell A4 and the return of 41,222, which is the standard value for 5 studeni 2012th

Now enter the formula = A5-A4 in cell A6. It will display 550, the number of days between the 5th May 2011 and 5 November 2012.

DATEVALUE (date_text) Converts a date in the form of text to code. Formatting cells as text A7 and enter the 09-May-11 in that cell. Then copy the = DATEVALUE (A7) in cell A8. This will return the serial value 40 672, which as you read above, the value date for the datum.Sljedeće three functions (with 40 672 still appears in cell A8) will prove to be so.

DAY (serial-number) returns the day (1-31) of date, so if = DAY (A8) is entered in cell A9, it will return the day of, 9

month (serial-number) returns the month (1-12) of date, so that = month (A8) entered in cell A10 will be back in a month, 5

YEAR (serial-number) returns the year (1900-9999) from the date, so that = year (A8) entered in cell A11 will come back year, 2011.

NOW is a simple function (without arguments) to enter the current date into a cell. It updates every day to change the date in a cell at the date of the current day (which is actually the date on your computer). Enter = TODAY () in cell A13 on the example list (yes, we left empty cell A12) and if the function does not show today's date correctly set the date on your computer.

Now, let's set the worksheet to the next function. Enter your birth date in cell A12.

DATEDIF (first_date, second_date, return_type) returns the difference between two dates in different ways as indicated in return_type. Return type the letter "d", "m", "Y" or a combination thereof (assumed the double quotes, or entered into a cell without the quotation marks, if the function will refer to the station (s) in return_type argument - see example below ).

Although DATEDIF is available as a function in Excel for 15 years or more, it is not included in the Excel Help documentation is included in the drop-down list Date and time of the function on the dialog Insert function of the frame and can be accessed by clicking on the FX. To use DATEDIF is therefore necessary to type the function directly in the cell, -. But knowing how to use it can be handy

Copy the formula = DATEDIF (A12, A13, "D ") and paste it into cell A14.First_date is your date of birth, second_date today's date and the result is displayed in cell A14 is the number of days between the two datuma.Formula = A13-A12 to produce the same result.

Now type the letter D (without the quotes) in cell B15 and copy the = DATEDIF (A12, A13, B15) in cell A15. Same result ... your age in days.

Then, copy the formula = DATEDIF (A12, A13, "m ") in cell A16 and = DATEDIF (A12, A13," Y ") in cell A17. the results of their age in completed months and year ended.

Return_type "YD" gives the number of days of ignoring the years, "YM" gives the number of months, ignoring the years, "MD" indicates the number of days, ignoring the months and years. Try editing the formula in cell A16 or A17 to see how these work.

Now, let's include the text of the concatenation (using the ampersand) to see what we can come up with. Copy the following formula (the = sign "after the word old) in cell A18 ...
= "Today I" & DATEDIF (A12, A13, "Y") & "years", and DATEDIF (A12, A13, "YM") & "months" & DATEDIF (A12, A13, "MD") & "days old"

There are several other functions of date, some of which are available only in Excel 2007 onwards.

DAYS360 (start_date, end_date, method) returns the number of days between two dates based on 360 days per year (twelve 30-day months ).

EDATE start_date, months) returns the serial number of the date determined by the number of months before or after start_date.

EOMONTH (start_date, months) returns the serial number of the last day of the month before or after a specified number of months.

NETWORKDAYS (start_date, end_date, holidays) returns the number of whole workdays between two dates, excluding certain holidays. This function is considered from Monday to Friday as working days and holidays can be specific dates or serial values.

day (serial_number, return_type) returns the number between 0 and 6 or between 1 and 7 (depending on return_type) that identifies the day of the week. It is easier to use a custom format "ddd" or "dddd ".

WEEKNUM (serial-number, return_type) Converts a serial number (date) to the number representing the number of weeks (numerically) in the year. There are a few quirks of this function - WEEKNUM type in the search Excel Help for details

.

weekday (start_date, days, holidays) returns the serial number of the date before or after a specified number of working days, except holidays.

YEARFRAC (start_date, end_date, basis) returns the part of the year that the number of whole days between start_date and end_date.

Now, here are a few interesting things to try on the worksheet.

Add days to date ... Enter the date in cell A19. Any date will do - and to the shape you want. Then in cell A20 enter the formula = A19 one day add a date in cell A19. Then, copy the formula and paste it into cell A21 to A25.

Convert values ​​... Select cell A20 and A25 to convert formulas to values ​​(copy, right click on one of the cells, select Paste Special on the pop-up menu, and select values ​​and click OK. then press Esc to clear the black ants marching ).

Fill in the dates below ... Select the bottom of a few cells and drag the fill handle in cell A25 down about 40 or 50 rows. (Fill handle is a small black square in the lower right corner of the selected cell). When the mouse button is released, autofill Options button appears next to the bottom of the cell. Click on this button and select Fill Weekdays at pop-up menu. Now look carefully at the dates.

See what a day every day is ... Scroll back to the line 20 and enter the formula = A20 in cell B20 . Then the custom format cell B20 as the "DDD". To do this, right click on the B20, select Format Cells, select the Custom tab on the number of Format Cells dialog box, and then Overtype whatever is in the Type field with DDD (without the quotes ).

Fill in the days down ... With cell B20 selected, double click on the day fill to put in a cell next to the date. Excel has copied the formula from cell B20 below, adjust the cell reference in each cell, and also copy formatting.

Display the year and month in one cell ... in a database that contains a column of dates is often desirable to filter or aggregate data per month, and easy way to do to add a column showing the year and month (as a decimal number) with each day. Here's how.

Select cell C20 and form a number with two decimal places (do not show a comma to separate). Then copy the formula = year (A20) + (month (A20) / 100) in cell C20 and double-click the fill handle to copy the formula (and design) down. Then insert three blank rows above row 20 (select rows 20-22, right click and choose Insert) and enter some numbers in column D in cell D23 to the bottom of the database (enter 1, 2, 3 in cells D23, D24 and D25 then double click on the fill ).

Place the column heading Date, Day, YM and No in cells A22 to D22, make them bold and focused on their the cells. Then turn on the auto filter (select cell in the database, and then in Excel 1997-2003 click on Data, Filter, Auto Filter, or in Excel 2007 or later, click the Data tab, then the filter icon). Now copy this formula = TOTAL (9, D23: D100) in cell D21 and filter the database for one month in the YM column. Take note of the subtotal, and then filter YM for the second month, a look at the subtotal.

So there you ... Dates in Excel are numbers that can be sorted, formatted, calculated in different ways, using functions or ordinary formula - and they can be used to filter the data.

The only drawback , which is dated before 1 January 1900 (the 1900 date system) on or before January 2, 1904 (the 1904 date system) can 't be entered in Excel as a date. They must be entered as text and can be used in formulas or numeric date function ... unless the old dates are converted to a date that Excel will recognize as a date.

First, a little explanation ... Leap years evenly divisible by four, unless they are century years such as 1900, in which case it must be evenly divisibly for the 400th This means that your calendar (including any days that fall on the dates) repeats every 400 years. So ...

Press Ctrl + Home on the test list and into ninth May 1611 as 9/5/1611 (Australian date format) or 05/09/1611 (U.S. date format) in cell C1. Although the entry of cells looks like a date for you, Excel's text.

Furthermore, if the dates in your computer is set to dd / mm / yyyy format, first copy the formula below in cell D1, but if you use mm / dd / yyyy date format, copy the second formula below in cell D1. ..

= DATE (VALUE (RIGHT (C1, 4)) 400, VALUE (MID (C1, 4,2)), value (LEFT (C1, 2 )))
= DATE (VALUE (RIGHT (C1, 4)) 400, VALUE (LEFT (C1, 2)), VALUE (MID (C1, 4,2 )))

which will give you a date that is 400 years after 1611 days - and this is a valid Excel date that can be used in calculations, etc. Also, if you just want to see what day of the week of May 9, 1611 was and if you use Excel 2007 or later, download the free Excel file named Continuous diary and Calendar.xlsx from the bottom of the Free Downloads page web site (link below). It contains a calendar that goes from year 1066 to In 3000

No comments:

Post a Comment