Forum Discussion
AnnaL71
Mar 13, 2024Copper Contributor
DATEDIF or other solution
I want to calculate the difference between a cell with the information:
2023-01-17 00:00:00.000
and a cell with the information
2022-11-21
I want the new cell to have the format "X years Y months" with the number of fulfilled years and months.
Cannot get the DATEDIF solution to work (Could it be because of a swedish version of excel - end what is then the right command in swedish?)
Anyone who could help!?
- PeterBartholomew1Silver Contributor
I have attached a workbook that, hopefully, will show the Swedish translation when you open it on your computer.
- JKPieterseSilver Contributor
AnnaL71 Try this:
- Open a blank workbook
- Enter a starting date in cell A1
- Enter the ending date in cell B1
- Select cell C1
- Press Alt+F11 to open the VBA Editor
- Press control+g to open the "immediate pane"
- Type the line below and press Enter:
ActiveCell.Formula = "DATEDIF(A1,B1,""y"")" - You should now have the Swedish formula in cell C1
There is a free add-in called "Functions Translator". Click the Add-ins button on your Home tab and search for "functions". This add-in translates an English formula to your language of choice.