# Calculation Of Age

**URL:** https://community.automationedge.com/t/calculation-of-age/2490
**Category:** Get Help & Discuss
**Created:** [August 18, 2020, 12:09pm UTC](https://community.automationedge.com/t/calculation-of-age/2490 "2020-08-18T12:09:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sonam](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sonam](https://community.automationedge.com/u/sonam)
#### Post date: [August 18, 2020, 12:09pm UTC](https://community.automationedge.com/t/calculation-of-age/2490/1 "2020-08-18T12:09:52Z")

</div>

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|

---

<div class="post-metadata">

### Author: ![madhavi.bade](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@madhavi.bade](https://community.automationedge.com/u/madhavi.bade)
#### Post date: [August 19, 2020, 6:27am UTC](https://community.automationedge.com/t/calculation-of-age/2490/2 "2020-08-19T06:27:04Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sonam](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sonam](https://community.automationedge.com/u/sonam)
#### Post date: [August 19, 2020, 12:22pm UTC](https://community.automationedge.com/t/calculation-of-age/2490/3 "2020-08-19T12:22:00Z")

</div>

Hi Madhavi,

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

---

<div class="post-metadata">

### Author: ![suyat13](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@suyat13](https://community.automationedge.com/u/suyat13)
#### Post date: [September 8, 2021, 10:12am UTC](https://community.automationedge.com/t/calculation-of-age/2490/4 "2021-09-08T10:12:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![habibur.rahamanin.d](https://avatars.discourse-cdn.com/v4/letter/h/a698b9/32.png) [@habibur.rahamanin.d](https://community.automationedge.com/u/habibur.rahamanin.d)
#### Post date: [October 5, 2021, 6:55am UTC](https://community.automationedge.com/t/calculation-of-age/2490/5 "2021-10-05T06:55:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fbaldin](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/fbaldin/32/99_2.png) [@fbaldin](https://community.automationedge.com/u/fbaldin)
#### Post date: [October 5, 2021, 8:20pm UTC](https://community.automationedge.com/t/calculation-of-age/2490/6 "2021-10-05T20:20:46Z")

</div>

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