A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
The formula itself looks valid, so if it works in Excel for the web but produces a syntax error in the desktop application, the issue is most likely related to your desktop Excel's regional settings rather than the formula itself.
Many desktop installations of Excel use semicolons (;) instead of commas (,) to separate function arguments. Try replacing the commas with semicolons so the formula becomes =DATEDIF(E2;TODAY();"Y")-5. If this works, your Excel is configured to use semicolons as the list separator.
Another possibility is that the value in cell E2 is stored as text instead of a real date. Although your screenshot suggests a parsing error rather than a data issue, it is still worth confirming that E2 contains a valid Excel date.
You can also test whether your Excel uses commas or semicolons by entering either =SUM(1,2) or =SUM(1;2). Whichever formula works indicates the correct argument separator for your installation.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin