[:sr]Excel funkcija DATEDIF[:en]Excel function DATEDIF[:]

[:sr]

Excel funkcija DATEDIF Izračunava broj dana, meseci ili godina između dva datuma.

Upozorenje: Funkcija DATEDIF može da izračuna pogrešne rezultate u određenim scenarijima. Pročitajte odeljak sa poznatim problemima u ovom članku da biste dobili više detalja.

Sintaksa Excel funkcija DATEDIF

DATEDIF(datum_početka,datum_završetka,jedinica)Datum_početka

Datum koji predstavlja datum prvog ili početnog perioda. Datume možete da unesete kao tekstualne niske pod navodnicima (na primer, „2001/1/30“), kao redne brojeve (na primer 36921, koji predstavlja 30. januar 2001. ako koristite datumski sistem 1900) ili kao rezultate drugih formula ili funkcija (na primer DATEVALUE(“2001/1/30”)).

Datum_završetka     Datum koji predstavlja datum poslednjeg ili završnog perioda.

Jedinica     Tip informacija koje želite da vratite:

Jedinica Daje
„Y“ Broj celih godina u periodu.
„M“ Broj celih meseci u periodu.
„D“ Broj dana u periodu.
„MD“ Razlika između dana u okviru datum_početka i datum_završetka. Meseci i godine datuma se zanemaruju.

VAŽNO : Ne preporučujemo da koristite argument „MD“, jer za njega postoje poznata ograničenja. Pročitajte odeljak sa poznatim problemima u nastavku.

„YM“ Razlika između meseci u okviru datum_početka i datum_završetka. Dani i godine datuma se zanemaruju
„YD“ Razlika između dana u okviru datum_početka i datum_završetka. Godine datuma se zanemaruju.

Primedbe

  • Datumi se skladište kao sekvencijalni redni brojevi, tako da se oni mogu koristiti u izračunavanjima. Podrazumevano je da 31. decembar 1899. predstavlja redni broj 1, a 1. januar 2008. redni broj 39448 zato što dolazi 39.448 dana nakon 1. januara 1900.
  • Funkcija DATEDIF je korisna u formulama koje treba da izračunaju starost.

Poznati problemi

Argument „MD“ može dati rezultat koji je negativan broj, nula ili netačan. Evo privremenog rešenja ako pokušavate da izračunate preostale dane posle poslednjeg proteklog meseca:

=DATEDIF(D17,E17,"md") i rezultat: 5

Ova formula oduzima prvi dan meseca koji se završava (1.5.2016.) od originalnog datuma završetka u ćeliji E17 (6.5.2016.). Evo kako ona to radi: Prva funkcija DATE pravi datum,1.5.2016. Pravi ga pomoću godine u ćeliji E17 i meseca u ćeliji E17. Zatim 1 predstavlja prvi dan tog meseca. Rezultat funkcije DATE jeste 1.5.2016. Zatim oduzimamo to od originalnog datuma završetka u ćeliji E17, koji je 6.5.2016. 6.5.2016. minus 1.5.2016. iznosi 5 dana.

[:en]Excel function DATEDIF Calculates the number of days, months or years between two dates.

Warning: The DATEDIF function may calculate erroneous results in certain scenarios. Read the section on known issues in this article for more details.

Syntax Excel function DATEDIF

DATEDIF (start_date, end_date, unit) Start_date

A date that represents the date of the first or initial period. You can enter dates as text strings in quotation marks (for example, “2001/1/30”), as ordinal numbers (for example, 36921, which is January 30, 2001 if you use the 1900 date system), or as the result of other formulas or functions. (for example DATEVALUE (“2001/1/30”)).

End_Date The date that represents the date of the last or final period.

Unit Type of information you want to return:

Unit Gives
“Y” Number of whole years in the period.
“M” Number of whole months in the period.
“D” Number of days in the period.
MD

Difference between start date and end date. The months and years of the date are ignored.

IMPORTANT: We do not recommend using the “MD” argument, as there are known limitations to it. Read the section with known issues below.

“YM” Difference between months within start_date and end_date. Days and years of the date are ignored
“YD” Difference between start date and end date. Date years are ignored.
Remarks
Dates are stored as sequential ordinal numbers so that they can be used in calculations. It is understood that December 31, 1899 is ordinal number 1, and January 1, 2008 is ordinal number 39448 because it comes 39,448 days after January 1, 1900.
The DATEDIF function is useful in formulas that need to calculate age.

Known issues

The “MD” argument can give a result that is a negative number, zero or incorrect. Here’s a workaround if you’re trying to calculate the remaining days after the last month:

This formula subtracts the first day of the month ending (May 1, 2016) from the original end date in cell E17 (May 6, 2016). Here’s how it works: The first DATE function makes a date, 1.5.2016. Make it using the year in cell E17 and the month in cell E17. Then 1 represents the first day of that month. The result of the DATE function is May 1, 2016. Then we subtract that from the original completion date in cell E17, which is May 6, 2016. 5/6/2016 minus 5/1/2016 is 5 days.[:]

[:sr] Ocenite [:en]Rate this [:]post