Forum Discussion

AnnaL71's avatar
AnnaL71
Copper Contributor
Mar 13, 2024

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!?

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor

    AnnaL71 Try this:

    1. Open a blank workbook
    2. Enter a starting date in cell A1
    3. Enter the ending date in cell B1
    4. Select cell C1
    5. Press Alt+F11 to open the VBA Editor
    6. Press control+g to open the "immediate pane"
    7. Type the line below and press Enter:
      ActiveCell.Formula = "DATEDIF(A1,B1,""y"")"
    8. 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.

Resources