Przejdź do głównej zawartości

Jak obliczyć czas trwania usługi od daty wynajmu w Excelu?

Jeśli masz szereg danych, w tym nazwiska pracowników i ich datę dołączenia do firmy w arkuszu, teraz możesz obliczyć ich staż pracy, czyli dowiedzieć się, ile lat i miesięcy pracownik przepracował w Twojej firmie. W tym artykule opowiem o szybkiej metodzie rozwiązania tego zadania za Ciebie.

Oblicz staż pracy od daty wynajmu za pomocą funkcji YEARFRAC

Oblicz staż pracy od daty najmu za pomocą funkcji DATEDIF

Oblicz staż pracy od daty wynajmu do dnia dzisiejszego za pomocą funkcji DATEDIF

Oblicz czas trwania usługi od daty wynajmu dzięki niesamowitej funkcji


Oblicz staż pracy od daty wynajmu za pomocą funkcji YEARFRAC

Aby obliczyć staż pracy od daty wynajmu i określonej daty, pomoże Ci funkcja YEARFRAC.

Wprowadź lub skopiuj następującą formułę do pustej komórki:

=INT(YEARFRAC(B2,C2))

Note: W powyższym wzorze, B2 to komórka z datą wynajmu, a C2 to komórka z datą zakończenia.

Następnie przeciągnij uchwyt wypełniania, aby skopiować fromula do innych potrzebnych komórek, a uzyskasz długość służby osoby w latach.


Oblicz staż pracy od daty najmu za pomocą funkcji DATEDIF

Jeśli chcesz obliczyć staż pracy w dokładnych latach, miesiącach i dniach, funkcja DATEDIF w programie Excel może Ci wyświadczyć przysługę.

Oblicz staż pracy w latach:

Wprowadź lub skopiuj następującą formułę do pustej komórki:

=DATEDIF(B2, C2, "y")& " Years"


Oblicz staż pracy w latach i miesiącach:

Proszę zastosować następującą formułę:

=DATEDIF(B2,C2,"y")&" Years, "&DATEDIF(B2,C2,"ym")&" Months"


Oblicz staż pracy w latach, miesiącach i dniach:

Zastosuj następującą formułę:

=DATEDIF(B2,C2,"y") & " Years, " & DATEDIF(B2,C2,"ym") & " Months, " & DATEDIF(B2,C2,"md") & " Days"

Note: W powyższym wzorze, B2 to komórka z datą wynajmu, a C2 to komórka z datą zakończenia.


Oblicz staż pracy od daty wynajmu do dnia dzisiejszego za pomocą funkcji DATEDIF

Niektórzy mogą chcieć obliczyć staż pracy od daty wynajmu do dzisiaj, więc każdego dnia otwierasz arkusz roboczy, długość usługi będzie aktualizowana automatycznie. W takim przypadku należy połączyć funkcję DZIŚ w ramach funkcji DATA.JEŻELI.

Zastosuj jedną z poniższych formuł do swoich potrzeb:

=DATEDIF(B4, TODAY(), "y")& " Years"
= DATEDIF (B4; DZIŚ (); „y”) & „Lata” & DATEDIF (B4; DZIŚ (); „ym”) & „Miesiące”
= DATEDIF (B6; DZISIAJ (); „y”) & „Lata” & „DATEDIF (B4, DZIŚ ();„ ym ”) &„ Miesiące ”& DATEDIF (B4, DZIŚ (),„ md ”) & „Dni”


Oblicz czas trwania usługi od daty wynajmu dzięki niesamowitej funkcji

Zapamiętanie tak wielu formuł jest nieco trudne, ale jeśli tak, to masz Kutools dla programu Excel, Z siedzibą w Pomocnik daty i godziny funkcja, możesz szybko obliczyć staż pracy w latach, miesiącach, dniach, latach + miesiącach + dniach lub w innych formatach według potrzeb.

Uwaga:Aby to zastosować Pomocnik daty i godziny, po pierwsze, należy pobrać plik Kutools dla programu Excel, a następnie szybko i łatwo zastosuj tę funkcję.

Po zainstalowaniu Kutools dla programu Excel, zrób tak:

1. Kliknij komórkę, w której chcesz zlokalizować wynik, a następnie kliknij KutoolsPomocnik formuły > Pomocnik daty i godzinyzobacz zrzut ekranu:

2, w Pomocnik daty i godziny w oknie dialogowym wykonaj następujące operacje:

  • Kontrola Różnica opcja z Rodzaj Nieruchomości Sekcja;
  • W Wprowadzanie argumentów pola tekstowe, zaznacz komórki, które zawierają oddzielnie datę najmu i datę zakończenia;
  • Następnie wybierz żądany typ wyniku wyjściowego. Na przykład staż pracy można określić w latach, miesiącach, latach + miesiące + dni, lata + miesiące itd.

3. Po zakończeniu ustawień kliknij OK przycisk, a otrzymasz pierwszy obliczony wynik, a następnie wystarczy przeciągnąć uchwyt wypełniania, aby wypełnić tę formułę, aby przetestować komórki, a teraz otrzymasz następujący wynik, zgodnie z potrzebami:

Kliknij, aby pobrać Kutools dla programu Excel i bezpłatną wersję próbną teraz!


Więcej artykułów względnych:

  • Policz liczbę dni / dni roboczych / weekendów między dwiema datami
  • Czy kiedykolwiek musiałeś policzyć liczbę dni między dwiema datami w programie Excel? Czasami po prostu chcesz obliczyć tylko dni robocze między dwiema datami, a czasami musisz liczyć tylko dni weekendu między dwiema datami. Jak możesz policzyć liczbę dni między dwiema datami w określonym stanie?
  • Oblicz dni, godziny i minuty między dwiema datami
  • Przypuśćmy, że masz dwie kolumny komórek daty i godziny, a teraz chcesz obliczyć różnicę w dniach, godzinach i minutach między tymi dwiema komórkami daty i godziny, jak pokazano na zrzucie ekranu. W tym artykule omówię kilka metod rozwiązania tego zadania.

Najlepsze narzędzia biurowe

🤖 Pomocnik AI Kutools: Zrewolucjonizuj analizę danych w oparciu o: Inteligentne wykonanie   |  Wygeneruj kod  |  Twórz niestandardowe formuły  |  Analizuj dane i generuj wykresy  |  Wywołaj funkcje Kutools...
Popularne funkcje: Znajdź, wyróżnij lub zidentyfikuj duplikaty   |  Usuń puste wiersze   |  Łącz kolumny lub komórki bez utraty danych   |   Okrągły bez wzoru ...
Super wyszukiwanie: Wiele kryteriów VLookup    Wiele wartości VLookup  |   Przeglądanie pionowe na wielu arkuszach   |   Wyszukiwanie rozmyte ....
Zaawansowana lista rozwijana: Szybko twórz listę rozwijaną   |  Zależna lista rozwijana   |  Lista rozwijana wielokrotnego wyboru ....
Menedżer kolumn: Dodaj określoną liczbę kolumn  |  Przesuń kolumny  |  Przełącz stan widoczności ukrytych kolumn  |  Porównaj zakresy i kolumny ...
Polecane funkcje: Fokus siatki   |  Widok projektu   |   Duży pasek formuły    Menedżer skoroszytów i arkuszy   |  Biblioteka zasobów (Automatyczny tekst)   |  Selektor dat   |  Połącz arkusze   |  Szyfruj/odszyfruj komórki    Wysyłaj e-maile według listy   |  Super filtr   |   Specjalny filtr (filtruj pogrubienie/kursywa/przekreślenie...) ...
15 najlepszych zestawów narzędzi12 Tekst Tools (Dodaj tekst, Usuń znaki, ...)   |   50 + Wykres rodzaje (Wykres Gantta, ...)   |   40+ Praktyczne Wzory (Oblicz wiek na podstawie urodzin, ...)   |   19 Wprowadzenie Tools (Wstaw kod QR, Wstaw obraz ze ścieżki, ...)   |   12 Konwersja Tools (Liczby na słowa, Przeliczanie walut, ...)   |   7 Połącz i podziel Tools (Zaawansowane wiersze łączenia, Podział komórki, ...)   |   ... i więcej

Zwiększ swoje umiejętności Excela dzięki Kutools for Excel i doświadcz wydajności jak nigdy dotąd. Kutools dla programu Excel oferuje ponad 300 zaawansowanych funkcji zwiększających produktywność i oszczędzających czas.  Kliknij tutaj, aby uzyskać funkcję, której najbardziej potrzebujesz...

Opis


Karta Office wprowadza interfejs z zakładkami do pakietu Office i znacznie ułatwia pracę

  • Włącz edycję i czytanie na kartach w programach Word, Excel, PowerPoint, Publisher, Access, Visio i Project.
  • Otwieraj i twórz wiele dokumentów w nowych kartach tego samego okna, a nie w nowych oknach.
  • Zwiększa produktywność o 50% i redukuje setki kliknięć myszką każdego dnia!
Comments (20)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
First, thank you very much for helping us!

I am trying to use the formula for years and months of service (=DATEDIF(B2,C2,"y")&" Years, "&DATEDIF(B2,C2,"ym")&" Months") which works great, but I would like to add that line and another line that just has numbers in it. Is that possible? For instance: The formula =DATEDIF(B2,C2,"y")&" Years, "&DATEDIF(B2,C2,"ym")&" Months" is located in D2 and I would like to add number of years and months of service from another agency in E2 with the total sum in F2.

All assistance is great appreciated.
Rated 5 out of 5
This comment was minimized by the moderator on the site
If I have a mixed list of employees still with the company (with start date only) and employees no longer with the company (with start and end date), is there a formula for calculating length of service using current date unless there is an end date, in which case the end date would be used in place of the current date to calculate total length of service from start to end?
This comment was minimized by the moderator on the site
what version of Excel can i get this? I am unable to get the function on Excel 2016
This comment was minimized by the moderator on the site
Hello,
The Excel version in the example is Excel 2010. The DATEDIF function is not available in Excel 2013 and later versions.
DATEDIF is not a standard function and hence not part of functions library and so no documentation. Microsoft doesn't promote to use this function as it gives incorrect results in few circumstances.

This function does not appear in the 'Insert Function' dialog box and is not recognised in the 'Function Arguments' dialog box.
The accuracy of this function was improved slightly in Excel 2010 but some of the bugs were never fixed.

Hope it helps. Have a nice day.
Sincerely,
Mandy
This comment was minimized by the moderator on the site
After the years of service has been determined. How do you calculate the persons service computation date (SCD). Is there a formula to subtract the years of service from the persons new appointment date to get their SCD leave date?
This comment was minimized by the moderator on the site
i m in problem; I am new joining to Govt. dept. as Junior Clerk in Accounts site: I want to calculate to make service end period, and after to add extra months years days in service period given by government relaxation period to complete service 9 to 10 years as (the total service is 8 year, 8 months, 18 days) but govt. give 10 months and 28 days to compile the service period for allowing the come in to as pensioner. Thanks to you for solve that problem.
This comment was minimized by the moderator on the site
Dear have a good health to you. I requesting for adjust more months days year in less service length 9 years to make complet 10 years. please tell about it.
This comment was minimized by the moderator on the site
How can I just highlight the cells if the yearly anniversary is within a week? For example They started on 01/10/2020 and I want the start date to be highlighted yellow if the date is 24/09 in each year and then turn red if the anniversary has passed, so turn red 7 days after the 1st?
This comment was minimized by the moderator on the site
Work Services Calculation 1 month different in formula
This comment was minimized by the moderator on the site
If service is 25 Year 07 Months 05 Days than i calculate no. of year and the result is 25, but need to calculate/consider full year if months is equal to 06 months or exceed. After calculation
This comment was minimized by the moderator on the site
For calculating the length of services in years, months and days with start date and end date, I noted that the result for James is 20 days. I would like to confirm if the end date means separation effective date (Day 1 after termination/separation) or last employment date.
Both start (hire date) and end date (last employment date "LED") should be inclusive in the calculation. It is expected to return 21 days but not 20 days as it counted no. of days from 12/11/2025 to 12/31/2025.
How to change the formula? Or should it be used termination effective date (LED + 1 day) as cell C2, instead of input "LED" as end date?
This comment was minimized by the moderator on the site
Florence, you are correct, and the tutorial above is simply wrong. When calculating years of service/length of service, the calculation must be inclusive of the last day worked. Using basic date subtraction formulas tell the *difference* between 2 dates (which will short the length of service by 1 day). For example, if someone stated the 1st, and ended the following day (2nd), taking the date difference would be 1 day (when they actually worked 2 days). Another example: If you use the method above for someone who started work on January 1st, and their last day was December 31st, it will not show that they've worked a complete year -- which is of course an error. The way to get the correct answer is to add +1 to the end date. So, everywhere you see C2 above should be C2+1. This is a significant problem where people everywhere are using this incorrect formula for calculating years of service. The formula is typically correct except the edge case of the last day of employment being the exact day before their start day. I'm in a dispute with my former employer over this very issue. Formulas like this should always be checked for edge cases like worked 1 day, 2 days, worked exactly 1 year, the anniversary date, day before/after, etc. When doing this, you will see all sorts of problems like the one you described.
This comment was minimized by the moderator on the site
Hi, Florence,If you want to include both the start date and end date when calculating, you just need add 1 after the days part as below formula:=DATEDIF(B2,C2,"y") & " Years, " & DATEDIF(B2,C2,"ym") & " Months, " & DATEDIF(B2,C2,"md")+1 & " Days"
Please try, hope it can help you!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations