Ir para o conteúdo principal

Como calcular o tempo de serviço a partir da data de contratação no Excel?

Se você tem uma série de dados, incluindo nomes de funcionários e sua data de entrada na empresa em uma planilha, agora, você pode querer calcular o tempo de serviço, isso significa quantos anos e meses um funcionário trabalhou para sua empresa. Neste artigo, vou falar sobre um método rápido para resolver esse trabalho para você.

Calcule o tempo de serviço a partir da data de contratação com a função YEARFRAC

Calcule o tempo de serviço a partir da data de contratação com a função DATEDIF

Calcule o tempo de serviço desde a data de contratação até hoje com a função DATEDIF

Calcule o tempo de serviço a partir da data de contratação com um recurso incrível


Calcule o tempo de serviço a partir da data de contratação com a função YEARFRAC

Para calcular o tempo de serviço a partir da data de contratação e uma data específica, a função YEARFRAC pode ajudá-lo.

Insira ou copie a seguinte fórmula em uma célula em branco:

=INT(YEARFRAC(B2,C2))

Note: Na fórmula acima, B2 é a célula da data de contratação e C2 é a célula da data de término.

Em seguida, arraste a alça de preenchimento para copiar a fromula para outras células de que você precisa e você obterá o tempo de serviço da pessoa em anos.


Calcule o tempo de serviço a partir da data de contratação com a função DATEDIF

Se você precisar calcular o tempo de serviço em anos, meses e dias exatos, a função DATEDIF do Excel pode fazer um favor.

Calcule o tempo de serviço em anos:

Insira ou copie a seguinte fórmula em uma célula em branco:

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


Calcule o tempo de serviço em anos e meses:

Por favor, aplique a seguinte fórmula:

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


Calcule o tempo de serviço em anos, meses e dias:

Aplique a seguinte fórmula:

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

Note: Na fórmula acima, B2 é a célula da data de contratação e C2 é a célula da data de término.


Calcule o tempo de serviço desde a data de contratação até hoje com a função DATEDIF

Algumas vezes, você pode querer calcular o tempo de serviço desde a data de contratação até hoje, então, a cada dia que você abrir a planilha, o tempo de serviço será atualizado automaticamente. Nesse caso, você deve combinar a função TODAY com a função DATEDIF.

Por favor, aplique qualquer uma das fórmulas abaixo conforme sua necessidade:

=DATEDIF(B4, TODAY(), "y")& " Years"
= DATEDIF (B4, TODAY (), "y") & "Anos," & DATEDIF (B4, TODAY (), "ym") & "Meses"
= DATEDIF (B6, TODAY (), "y") & "Anos," & DATEDIF (B4, TODAY (), "ym") & "Meses," & DATEDIF (B4, TODAY (), "md") & " Dias"


Calcule o tempo de serviço a partir da data de contratação com um recurso incrível

É um pouco difícil para você se lembrar de tantas fórmulas, mas, se você tiver Kutools for Excel, Com o seu Auxiliar de data e hora recurso, você pode calcular rapidamente a duração do serviço em anos, meses, dias, anos + meses + dias ou outros formatos conforme necessário.

Observação:Para aplicar isso Auxiliar de data e hora, em primeiro lugar, você deve baixar o Kutools for Excele, em seguida, aplique o recurso de forma rápida e fácil.

Depois de instalar Kutools for Excel, por favor, faça o seguinte:

1. Clique na célula onde deseja localizar o resultado e clique em KutoolsFórmula Helper > Ajudante de data e hora, veja a captura de tela:

2. No Auxiliar de data e hora caixa de diálogo, faça as seguintes operações:

  • Verifique Diferença opção do Formato seção;
  • No Entrada de argumentos caixas de texto, selecione as células que contêm a data de contratação e a data de término separadamente;
  • Em seguida, escolha o tipo de resultado de saída conforme necessário. Por exemplo, você pode obter o tempo de serviço em anos, meses, anos + meses + dias, anos + meses e assim por diante.

3. Depois de terminar as configurações, clique OK botão, e você obterá o primeiro resultado calculado, então, você só precisa arrastar a alça de preenchimento para preencher esta fórmula para testar células, e agora você obterá o seguinte resultado conforme necessário:

Clique para baixar o Kutools para Excel e testar gratuitamente agora!


Mais artigos relativos:

  • Conte o número de dias / dias úteis / fins de semana entre duas datas
  • Você já precisou contar o número de dias entre duas datas no Excel? Pode ser, às vezes, você apenas deseja calcular os dias úteis entre duas datas e, às vezes, você precisa contar os dias de fim de semana apenas entre as duas datas. Como você poderia contar o número de dias entre duas datas em uma determinada condição?
  • Calcular dias, horas e minutos entre duas datas
  • Supondo que você tenha duas colunas de células de data e hora e, agora, deseja calcular a diferença em dias, horas e minutos entre essas duas células de data e hora, como mostrado a seguir. Neste artigo, vou falar sobre alguns métodos para resolver essa tarefa para você.

Melhores ferramentas de produtividade de escritório

🤖 Assistente de IA do Kutools: Revolucionar a análise de dados com base em: Execução Inteligente   |  Gerar Código  |  Crie fórmulas personalizadas  |  Analise dados e gere gráficos  |  Invocar funções do Kutools...
Recursos mais comuns: Encontre, destaque ou identifique duplicatas   |  Excluir linhas em branco   |  Combine colunas ou células sem perder dados   |   Rodada sem Fórmula ...
Super pesquisa: VLookup de múltiplos critérios    VLookup de múltiplos valores  |   VLookup em várias planilhas   |   Pesquisa Difusa ....
Lista suspensa avançada: Crie rapidamente uma lista suspensa   |  Lista suspensa de dependentes   |  Lista suspensa de seleção múltipla ....
Gerenciador de colunas: Adicione um número específico de colunas  |  Mover colunas  |  Alternar status de visibilidade de colunas ocultas  |  Compare intervalos e colunas ...
Recursos em destaque: Foco da Grade   |  Vista de Design   |   Grande Barra de Fórmula    Gerenciador de pastas de trabalho e planilhas   |  Biblioteca (Auto texto)   |  Data Picker   |  Combinar planilhas   |  Criptografar/Descriptografar Células    Enviar e-mails por lista   |  Super Filtro   |   Filtro Especial (filtro negrito/itálico/tachado...) ...
15 principais conjuntos de ferramentas12 Texto Ferramentas (Adicionar texto, Remover Personagens, ...)   |   50+ de cores Tipos (Gráfico de Gantt, ...)   |   Mais de 40 práticos Fórmulas (Calcule a idade com base no aniversário, ...)   |   19 Inclusão Ferramentas (Insira o código QR, Inserir imagem do caminho, ...)   |   12 Conversão Ferramentas (Números para Palavras, Conversão de moedas, ...)   |   7 Unir e dividir Ferramentas (Combinar linhas avançadas, Dividir células, ...)   |   ... e mais

Aprimore suas habilidades de Excel com o Kutools para Excel e experimente uma eficiência como nunca antes. Kutools para Excel oferece mais de 300 recursos avançados para aumentar a produtividade e economizar tempo.  Clique aqui para obter o recurso que você mais precisa...

Descrição


Office Tab traz interface com guias para o Office e torna seu trabalho muito mais fácil

  • Habilite a edição e leitura com guias em Word, Excel, PowerPoint, Publisher, Access, Visio e Project.
  • Abra e crie vários documentos em novas guias da mesma janela, em vez de em novas janelas.
  • Aumenta sua produtividade em 50% e reduz centenas de cliques do mouse para você todos os dias!
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