Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-29-2024, 04:35 AM
Pablo2000 Pablo2000 is offline datedif() Windows 11 datedif() Office 2021
Advanced Beginner
datedif()
 
Join Date: Dec 2023
Posts: 56
Pablo2000 is on a distinguished road
Default datedif()

I want to calculate the difrence between old date and now in months. MS has examples of datedif() but another website says that datedif is depreciated and no longer used. Replaced by YEARFRAC()



Confused.
=DATEDIF(2023/1/1,2024/1/1,"M") = 0
Reply With Quote
  #2  
Old 09-29-2024, 06:29 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline datedif() Windows 10 datedif() Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

You need to add double quotes when you do not reference cells
Code:
=DATEDIF("2023/1/1","2024/1/1","M") = 12
Excel DATEDIF function | Exceljet
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 10-01-2024, 10:50 PM
ArviLaanemets ArviLaanemets is offline datedif() Windows 8 datedif() Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Or use DATESERIAL() - the formula will work with any local setting then
Code:
=DATEDIF(DATESERIAL(2023,1,1),DATESERIAL(2024,1,1),"M")
Reply With Quote
  #4  
Old 10-02-2024, 09:55 AM
Pablo2000 Pablo2000 is offline datedif() Windows 11 datedif() Office 2021
Advanced Beginner
datedif()
 
Join Date: Dec 2023
Posts: 56
Pablo2000 is on a distinguished road
Default

Putting =DATEDIF(DATESERIAL(2023,1,1),DATESERIAL(2024,1,1) ,"M") into a cell gives me #NAME?
Reply With Quote
  #5  
Old 10-02-2024, 11:37 PM
ArviLaanemets ArviLaanemets is offline datedif() Windows 8 datedif() Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Quote:
Originally Posted by Pablo2000 View Post
Putting =DATEDIF(DATESERIAL(2023,1,1),DATESERIAL(2024,1,1) ,"M") into a cell gives me #NAME?
Microsoft is saying the function is DATEDIFF()!
Reply With Quote
  #6  
Old 10-02-2024, 11:42 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline datedif() Windows 10 datedif() Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Quote:
Originally Posted by ArviLaanemets View Post
Microsoft is saying the function is DATEDIFF()!
Where did you get that ? DATEDIF function - Microsoft Support
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #7  
Old 10-02-2024, 11:48 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline datedif() Windows 10 datedif() Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Quote:
Originally Posted by Pablo2000 View Post
Putting =DATEDIF(DATESERIAL(2023,1,1),DATESERIAL(2024,1,1) ,"M") into a cell gives me #NAME?
DATESERIAL is an ACCESS or VBA function. DATEDIF ( with one "F") is the way to go ( among others)
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #8  
Old 10-03-2024, 02:55 AM
ArviLaanemets ArviLaanemets is offline datedif() Windows 8 datedif() Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Quote:
Originally Posted by Pecoflyer View Post
DATESERIAL is an ACCESS or VBA function. DATEDIF ( with one "F") is the way to go ( among others)
Sorry! Somehow forgot, that the post wasn't about programming!
So
Code:
=DATEDIF(DATE(2023,1,1),DATE(2024,1,1),"m")
And why can't MS have unified naming conventions? The functions with identical names do something different, the functions which do the same thing, are named differently! Very confusing!

Last edited by ArviLaanemets; 10-03-2024 at 05:05 AM.
Reply With Quote
  #9  
Old 10-03-2024, 07:54 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline datedif() Windows 10 datedif() Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Quote:
Originally Posted by ArviLaanemets View Post
And why can't MS have unified naming conventions? The functions with identical names do something different, the functions which do the same thing, are named differently! Very confusing!
Perhaps to avoid confusion as the DATEDIFF and the DATEDIF ( not supported by MS anymore) functions have very different syntaxes?
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #10  
Old 10-02-2024, 01:41 PM
Alansidman's Avatar
Alansidman Alansidman is offline datedif() Windows 11 datedif() Office 2021
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 112
Alansidman has a spectacular aura aboutAlansidman has a spectacular aura aboutAlansidman has a spectacular aura about
Default

Did you try PecoFlyer's suggestion. His solution works for me.
__________________
Alan עַם יִשְׂרָאֵל חַ Using O365 v2505
Reply With Quote
  #11  
Old 10-18-2024, 08:17 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline datedif() Windows 10 datedif() Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

@Pablo2000 As all this helped? You did not react anymore?
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
DATEDIF issue teza2k06 Excel 2 11-14-2021 03:35 AM
datedif() Using DateDif Function OTPM Project 5 03-17-2014 05:16 AM
datedif() Help with DATEDIF Formula caz46 Excel 7 01-12-2012 08:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft