+ Reply to Thread
Results 1 to 12 of 12

Averaging out data from a DATEDIF Formula

Hybrid View

  1. #1
    Registered User
    Join Date
    08-01-2007
    Posts
    32

    Averaging out data from a DATEDIF Formula

    Hi All,

    Im going insane trying to figure out how to Average out the data i've accumulated with the DATEDIF Formula...Can anyone please clarify if this is even possible ??

    Here's the situation...

    I've got a range of data that has been calculated by using the DATEDIF Function (below):

    =DATEDIF(H4,I4,"M")&" Months, " &DATEDIF(H4,I4,"md")&" Days"
    This is working fine, im getting the desired results (eg: '3 Years, 5 Months')...however, i now need to calculate the average of my DATEDIF Results and none of the formula's i try seem to work ??

    I've attached a small example of the Table that needs to be populated...Column E just needs to display the average of all the data in Column D...

    Thanks in Advance for any help you can provide.

    Cheers - Darren
    Attached Files Attached Files
    Last edited by DarrenH; 04-10-2008 at 03:10 AM. Reason: Error attaching Book1

  2. #2
    Registered User
    Join Date
    08-01-2007
    Posts
    32
    ...Bump...

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Once you concatenated your data in column C to achieve your desired formatting, everything becomes a string (text) and thus Excel can't do numerical calculations on it. Can you have a hidden column with the DATEDIF formula without any extraneous formatting and use that to calculate your average?

    ChemistB

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If you want an average of rows 2 to 6 you can use

    =DATEDIF(AVERAGE(B2:B6),AVERAGE(C2:C6),"M")&" Months, " &DATEDIF(AVERAGE(B2:B6),AVERAGE(C2:C6),"md")&" Days"

  5. #5
    Registered User
    Join Date
    08-01-2007
    Posts
    32
    ChemistB - Cheers for the reply.

    I may be doing it wrong but i did try:
    =DATEDIF(H4,I4,"M")&"."&DATEDIF(H4,I4,"md")
    Which gave me a numerical result (eg: 3.2)...however when i try to calculate the average of these results i get the "#DIV/0!" error (i was was just using a straight forward Average function tho, below)
    =AVERAGE(O3:O59)
    Where am i going wrong, does it have something to do with the "." that i've included into the formula ??

  6. #6
    Registered User
    Join Date
    08-01-2007
    Posts
    32
    Daddylonglegs - Cheers for the Reply

    I'll need to use that piece of Code later on in the spreadsheet im developing, so thanks !!

    As for now tho, the data i need to Average out only sits in the one Column.

    Im still open to suggestions tho

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    I'm not sure I understand, then. What are you trying to average in E2, what result would you expect for your example?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1