Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calcular edad entre fecha dada y la fecha actual en años, meses y días

publicado

Estimados,

Buenas noches,

Requiero de su ayuda, con una función en Power Query, de un post de la web, estoy tratando de modificar, que me calcule la edad en años, meses y días, dando como parámetros una fecha de nacimiento y la fecha actual.

En el enlace solo esta en años y meses.

Según en mi archivo, lo que esta resaltado con amarillo no es igual a la columna anterior(esta hecha con formula SIFECHA().

Muy agradecido de antemano.

Web de ejemplo

Función del post

(yourdate as date)=>
let
    startdate=
    if yourdate>Date.From(DateTime.LocalNow()) then null else yourdate,
    MyYears=Number.RoundDown(Duration.TotalDays(Date.From(DateTime.LocalNow()) - startdate)/365),
    month1=Date.Month(Date.From(DateTime.LocalNow()))-Date.Month(Date.AddYears(startdate,MyYears)),
    mymonths=if month1<0 then 12+month1 else month1,
    Concat = 
    Text.From(MyYears) & " Yrs " & 
    Text.From(mymonths) & " Months"
in
    Concat

 

Calcular Edad años meses y dias.xlsx

Featured Replies

publicado
  • Autor

Buenas con todos,

Encontré la solución algo chapuzado. Si hay otra opción bienvenido.

let
    EdadCum = (tudia as date)=>
let
    iniciofecha=
    if tudia>Date.From(DateTime.LocalNow()) then null else tudia,
    
    
    MiAnio=Number.RoundDown(Duration.TotalDays(Date.From(DateTime.LocalNow()) - iniciofecha)/365),

    mes1=Date.Month(Date.From(DateTime.LocalNow()))-Date.Month(Date.AddYears(iniciofecha,MiAnio)),

    mimess=if mes1<=0 then 12-(1-mes1) else
           if Date.Day(Date.From(DateTime.LocalNow()))<Date.Day(Date.AddYears(iniciofecha,MiAnio)) then mes1-1  else mes1,
  	
    dia1=Date.Day(Date.From(DateTime.LocalNow()))-Date.Day(Date.AddMonths(iniciofecha,MiAnio)),
      
    midias=if dia1<0 then 31+dia1 else dia1,

    Concat = 
    Text.From(MiAnio) & " años " & 
    Text.From(mimess) & " meses " &
    Text.From(midias) & " dias"
in
    Concat
in
    EdadCum

 

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.