Forum Discussion

FlowTime1990's avatar
FlowTime1990
Brass Contributor
Dec 02, 2023

Years Of Experience Calculation

I have a SharePoint list which I calculated the years of experience at the time of Request.  So on the first line I calculated 15.03 on 11/09/2023.  I would like to add another YOE (years of experience) column that would add the difference, in years, between 11/09/2023 to today().  Essentially it would be dynamic as the dates move and get further away from the Request date.  Can I accomplish this via a Calculated column?

 

I found this online but it is showing in alot of decimal places, I cannot seem to cut it off at 2 decimal places 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=([$InternalEquityYOE] + ((Number(@now) - Number([$RequestedDate])) / (1000 * 60 * 60 * 24 * 365)))"
}

 

 

  • Kelly_Edinger's avatar
    Kelly_Edinger
    Bronze Contributor

    Hi FlowTime1990 - the only issue with using a Calculated column is that they're static. The calculations against Today will only happen when a line item is modified. You could create a Power Automate flow to run daily, do the math and then write to the number of years back to the columns.

Resources