web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Calculating age from b...
Power Automate
Answered

Calculating age from birth date and current date using Workflow Definition Language expressions

(0) ShareShare
ReportReport
Posted on by 52

If I have a date of birth (from a Microsoft form question) and have inserted it into an Excel table row, how would I calculate age using a Workflow Definition Expression which would be placed in an Excel table column beside the one for date of birth?

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @ras1000,

     

    Currently it is not possible to use a datediff function in flow to count days between two days. There is a similar request on Flow Ideas Forum, please vote the idea at here:

    https://powerusers.microsoft.com/t5/Flow-Ideas/workflow-definition-language-needs-to-be-expanded/idi-p/24641

     

     

    Best regards,

    Mabel Mao

  • Verified answer
    ras1000 Profile Picture
    52 on at

    I did manage to get age using ticks for the birthdate (from Microsoft Form field) and utcNow.  After dividing by a couple of constants I was able to get age as a float.

     
    Expression is:  div(div(sub(variables('Today'),variables('Birthdate')),864000000000),365.25)
     
    Variable Today is "ticks(utcNow())"
     
    Variable Birthdate is "
    ticks(body('Get_response_details')?['rde329303c5a04b32b9b9f35a0564400e']) based on Microsoft Form response field.
     
    At the end of the day I did not go ahead with the calculation as the result is not dynamic, i.e. result does not change if someone has a birthday.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard