# Need to calculate 2 cells with datedif formulas in them

#### Debra Lee

##### New Member
Good afternoon you wonderful people

A B C
Coverage Began Coverage Ended Time Covered
12/1/2002 9/30/2004 21 months, 29 days
10/1/2004 12/31/2004 2 months, 30 days

I have =DATEDIF(D10,E10,"m")&" months, "&DATEDIF(D10,E10,"md")&" days" in each cell in "C" colum

What formula can I use to calculate the "C" column- Total time covered?

### Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

#### RalphA

##### Well-known Member
Debra, here is one solution, assuming you want the total in days. (Oh, yes, I believe that your dates should be en columns D and E, instead of columns A and B, as you posted):
In F10, enter:
=DATEDIF(D10,E10,"d")
and copy down to the last cell you need, say F30.

In column C,:
In C31, enter:
=SUM(F10:F30)

Does this work for you?

In my Excel 97, the DATEDIF() function works well. But, I didn't find it listed in the fx place, nor in the HELP place. I have all the Excel-furnished addins installed, but no additional ones. How is it that the function works, but I can't seem to find it as an available function?

#### GorD

##### Well-known Member
RalphA said:
In my Excel 97, the DATEDIF() function works well. But, I didn't find it listed in the fx place, nor in the HELP place. I have all the Excel-furnished addins installed, but no additional ones. How is it that the function works, but I can't seem to find it as an available function?

I think I read somewhere that it is only included as a function for compatability with older versions of Lotus etc

#### Brian from Maui

##### MrExcel MVP
RalphA said:
In my Excel 97, the DATEDIF() function works well. But, I didn't find it listed in the fx place, nor in the HELP place. I have all the Excel-furnished addins installed, but no additional ones. How is it that the function works, but I can't seem to find it as an available function?

Hey Ralph, how's them BBQ down in Katy?

Here's Chip's explanation,

http://www.cpearson.com/excel/datedif.htm

#### barry houdini

##### MrExcel MVP
Debra Lee said:
I have =DATEDIF(D10,E10,"m")&" months, "&DATEDIF(D10,E10,"md")&" days" in each cell in "C" colum

What formula can I use to calculate the "C" column- Total time covered?

I contend that it's not really possible to get an accurate answer in these circumstances because of variable month lengths....but for something approximating a legitimate answer try

=DATEDIF(0,SUM(E1:E10)-SUM(D1:D10),"m")&" months, "&DATEDIF(0,SUM(E1:E10)-SUM(D1:D10),"md")&" days"

alter ranges as necessary

#### RalphA

##### Well-known Member
Hey, there, Brian from Maui, nice to hear from you! BBQing is pretty good, here, so, como on over and enjo! Thanks for Chip's location and explanation on the DATEDIF() function, it was very clear, complete, and authoritive.

Replies
3
Views
132
Replies
1
Views
122
Replies
4
Views
239
Replies
5
Views
516
Replies
10
Views
346

1,195,662
Messages
6,010,992
Members
441,579
Latest member
satishrazdhan

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back