Calculation Of Age

I have the list of users with DOB in an excel sheet and I want to calculate their age individually how can that be achieved in PS.
PFB example for reference.

|Name|DOB|
|George|1-Jan-04|
|Jacob|13-Mar-95|
|Clara|4-Oct-14|
|Emily|5-May-76|
|David|22-Jan-90|
|John|10-May-91|

Hi Sonam,
You can use Modified Java Script step to calculate age of each user.

Add Modified Java Script step in your workflow.
While reading, take datatype of DOB as date.
To calculate age, lets first take currentDate by using inbuilt Date() function of Java script.
Create new variable Age and call DateDiff() function. Pass required parameters.
First parameter would be DOB. Second parameter would be currentDate. In third parameter we need to mention either day or month or year in which we want to calculate the difference. We would mention “y” for year.It will give you age in no of years.

2 Likes

Hi Madhavi,

I tried to implement the above steps. Its working as expected. Thanks.

Respected Madhavi,
Can you elaborate more about how you can solve this.

Hi Madhavi,
Is there any other way of calculating age except the Modified Java Script step?

All steps done by Modified Java Scripts can be made using the Formula or Calculator Steps as well.