You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Date difference

Hi there,


I'm trying to use the 'DATEDIF' function to determine the number of days since a start date and the current date as per the image. In the 'Age' cell I'm using the formula with the Current Date below as the start date, and the 'Purchased' date as the End date and Days and the method. I get an error. What am I doing wrong - it says it's referencing its own cell but I can't see how as the result cell is separate from the various source cells.






iMac, macOS 10.13

Posted on Dec 19, 2022 12:01 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 19, 2022 7:29 AM

JP from EG wrote:

Hi there,

I'm trying to use the 'DATEDIF' function to determine the number of days since a start date and the current date


In Numbers with start date in C2, and end date in M1, you can just use


=M1-C2 to get the number of days.


You can also just use =TODAY()-C2.


If you need the number of days as decimals for further calculations you can use:


=DUR2DAYS(M1-C2) or =DUR2DAYS(TODAY()-C2)


SG

7 replies
Question marked as Top-ranking reply

Dec 19, 2022 7:29 AM in response to JP from EG

JP from EG wrote:

Hi there,

I'm trying to use the 'DATEDIF' function to determine the number of days since a start date and the current date


In Numbers with start date in C2, and end date in M1, you can just use


=M1-C2 to get the number of days.


You can also just use =TODAY()-C2.


If you need the number of days as decimals for further calculations you can use:


=DUR2DAYS(M1-C2) or =DUR2DAYS(TODAY()-C2)


SG

Dec 19, 2022 8:10 AM in response to JP from EG

HI JP,



Note the colour highlight in ALL CELLS of column D, including the cell (D2) containing the formula. That is the cause of the 'self reference' error.

'

The D is being read as a cell/column reference because it is not enclosed in a pair of double quotation marks, as seen in the image below, identifying it as the text code telling the formula to report the difference in days.


Note also the small triangle beside the "D". Clicking that triangle will open a four item menu from which you can select the unit used to express the DATEDIF.


The cell reference (Table 4::L1), pointed out by Ralf, will also trigger an error triangle in D2, but the error message for that error will be one for a 'wrong type of value', not the self reference error message seen in your screen shot.


Regards,

Barry



Dec 19, 2022 7:39 AM in response to SGIII

Thanks for both the suggestions. I will try each in the context I need.


Im still curious why the error message said “This formula can’t reference its own cell . . . . “ when the cell was only the result and not used for the equation components. Perhaps this is just the reaction when I seem to have selected a text entry for the ‘start date’ instead of a ‘date & time’ value?

Date difference

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.