Skip i'r prif gynnwys

Sut i gyfrifo hyd y gwasanaeth o'r dyddiad llogi yn Excel?

Os oes gennych ystod o ddata gan gynnwys enwau gweithwyr a'u dyddiad ymuno â'ch cwmni mewn taflen waith, nawr, efallai yr hoffech chi gyfrifo hyd eu gwasanaeth, mae'n golygu cael sawl blwyddyn a mis y mae gweithiwr wedi gweithio i'ch cwmni. Yr erthygl hon, byddaf yn siarad am ddull cyflym o ddatrys y swydd hon i chi.

Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi gyda swyddogaeth YEARFRAC

Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi gyda swyddogaeth DATEDIF

Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi hyd heddiw gyda swyddogaeth DATEDIF

Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi gyda nodwedd anhygoel


Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi gyda swyddogaeth YEARFRAC

I gyfrifo hyd y gwasanaeth o'r dyddiad llogi a dyddiad penodol, gall swyddogaeth YEARFRAC eich helpu.

Rhowch neu copïwch y fformiwla ganlynol i mewn i gell wag:

=INT(YEARFRAC(B2,C2))

Nodyn: Yn y fformiwla uchod, B2 yw'r gell dyddiad llogi a C2 yw'r gell dyddiad gorffen.

Yna llusgwch yr handlen lenwi i gopïo'r fromula i gelloedd eraill sydd eu hangen arnoch chi, a byddwch chi'n cael gwasanaeth hir y person mewn blynyddoedd.


Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi gyda swyddogaeth DATEDIF

Os oes angen i chi gyfrifo hyd y gwasanaeth mewn union flynyddoedd misoedd a dyddiau, gall swyddogaeth DATEDIF yn Excel wneud ffafr i chi.

Cyfrifwch hyd y gwasanaeth mewn blynyddoedd:

Rhowch neu copïwch y fformiwla ganlynol i mewn i gell wag:

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


Cyfrifwch hyd y gwasanaeth mewn blynyddoedd a misoedd:

Defnyddiwch y fformiwla ganlynol:

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


Cyfrifwch hyd y gwasanaeth mewn blynyddoedd, misoedd a dyddiau:

Defnyddiwch y fformiwla ganlynol:

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

Nodyn: Yn y fformiwla uchod, B2 yw'r gell dyddiad llogi a C2 yw'r gell dyddiad gorffen.


Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi hyd heddiw gyda swyddogaeth DATEDIF

Rhywbeth, efallai yr hoffech chi gyfrifo hyd y gwasanaeth o'r dyddiad llogi i heddiw, felly, bob dydd y byddwch chi'n agor y daflen waith, bydd hyd y gwasanaeth yn cael ei ddiweddaru'n awtomatig. Yn yr achos hwn, dylech gyfuno'r swyddogaeth HEDDIW o fewn swyddogaeth DATEDIF.

Defnyddiwch unrhyw un isod fformiwlâu i'ch angen:

=DATEDIF(B4, TODAY(), "y")& " Years"
= DATEDIF (B4, HEDDIW (), "y") a "Blynyddoedd," a DATEDIF (B4, HEDDIW (), "ym") a "Misoedd"
= DATEDIF (B6, HEDDIW (), "y") a "Blynyddoedd," & DATEDIF (B4, HEDDIW (), "ym") a "Misoedd," & DATEDIF (B4, HEDDIW (), "md") & "Dyddiau"


Cyfrifwch hyd y gwasanaeth o'r dyddiad llogi gyda nodwedd anhygoel

Mae hi braidd yn anodd ichi gofio cymaint o fformiwlâu, ond, os oes gennych chi hynny Kutools ar gyfer Excel, Gyda'i Cynorthwyydd Dyddiad ac Amser nodwedd, gallwch chi gyfrifo hyd y gwasanaeth yn gyflym mewn blynyddoedd, misoedd, dyddiau, blynyddoedd + misoedd + diwrnod neu fformatau eraill yn ôl yr angen.

Nodyn:I gymhwyso hyn Cynorthwyydd Dyddiad ac Amser, yn gyntaf, dylech lawrlwytho'r Kutools ar gyfer Excel, ac yna cymhwyswch y nodwedd yn gyflym ac yn hawdd.

Ar ôl gosod Kutools ar gyfer Excel, gwnewch fel hyn:

1. Cliciwch cell lle rydych chi am ddod o hyd i'r canlyniad, ac yna cliciwch KutoolsCynorthwyydd Fformiwla > Cynorthwyydd Dyddiad ac Amser, gweler y screenshot:

2. Yn y Cynorthwyydd Dyddiad ac Amser blwch deialog, gwnewch y gweithrediadau canlynol:

  • Gwirio Gwahaniaeth opsiwn gan y math adran;
  • Yn y Mewnbwn dadleuon blychau testun, dewiswch y celloedd sy'n cynnwys y dyddiad llogi a'r dyddiad gorffen ar wahân;
  • Yna, dewiswch y math o ganlyniad allbwn yn ôl yr angen. Er enghraifft, gallwch gael hyd y gwasanaeth mewn blynyddoedd, misoedd, blynyddoedd + misoedd + diwrnod, blynyddoedd + mis ac ati.

3. Ar ôl gorffen y gosodiadau, cliciwch OK botwm, a byddwch yn cael y canlyniad cyntaf wedi'i gyfrifo, felly, does ond angen i chi lusgo'r handlen llenwi i lenwi'r fformiwla hon i brofi celloedd, ac yn awr fe gewch y canlyniad canlynol yn ôl yr angen:

Cliciwch i Lawrlwytho Kutools ar gyfer Excel a threial am ddim Nawr!


Erthyglau mwy cymharol:

  • Cyfrif Nifer y Diwrnodau / Diwrnodau Gwaith / Penwythnosau Rhwng Dau Ddyddiad
  • Ydych chi erioed wedi gorfod cyfrif nifer y diwrnodau rhwng dau ddyddiad yn Excel? Efallai y bydd, weithiau, dim ond cyfrifo'r diwrnodau gwaith rhwng dau ddyddiad, a rhywbryd, dim ond rhwng y ddau ddyddiad y mae angen i chi gyfrif y dyddiau penwythnos. Sut allech chi gyfrif nifer y diwrnodau rhwng dau ddyddiad mewn cyflwr penodol?
  • Cyfrifwch Oriau Dyddiau a Munudau Rhwng Dau Ddyddiad
  • Gan dybio, mae gennych ddwy golofn o gelloedd amser dyddiad, ac yn awr, rydych chi am gyfrifo'r gwahaniaeth mewn dyddiau, oriau a munudau rhwng y ddwy gell amser dyddiad hyn fel y dangosir y screenshot canlynol. Yr erthygl hon, byddaf yn siarad am rai dulliau i ddatrys y dasg hon i chi.

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
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