+ Reply to Thread
Results 1 to 6 of 6

Averaging the Difference of Two Columns

  1. #1
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Averaging the Difference of Two Columns

    Hello,

    I would have been looking and cannot find a solution. But I am sure one of you can do it.

    I have 2 columns (B and C) with times listed from Row 2 and will continue down several hundred rows. In a single cell, I would like to put a formula that will average the difference in the times in each row (the value will be in seconds... maybe minutes and seconds).

    I tried to use this, but it didn't seem to work (Entered as an array):
    Please Login or Register  to view this content.
    Any help would be appreciated.

    Thanks,

    Mark

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You need to probably eliminate all the 0 entries....

    try:

    =AVERAGE(IF(C$2:C$65536+B$2:B$65536<>0,(C$2:C$65536-B$2:B$65536)*24*60*60))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158
    Thank you for yoru quick reply,it worked great. I didn't really worry about that part because I don't have actual zeros and I thought that AVERAGE ignored text and blanks.

    Thanks again

    Mark

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Because you are subtracting a blank from a blank, this results in the array containing 0's and therefore get factored into the Averaging...

    If you were straight averaging a range containing blanks, then the Average would ignore the blanks...

  5. #5
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158
    That makes sense since you put it that way. Thanks

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If every row has either dates in both columns or (blanks or text) in both columns,
    this non-CSE formula will work

    =(AVERAGE(A2:A65536)-AVERAGE(B2:B65536)) *60*60*24
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 08-04-2011, 09:32 AM
  2. Chart Columns in difference colours...
    By Eva_ in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-05-2008, 05:53 AM
  3. Setting Automatic Difference Across Columns Like AutoSum
    By Lavarinth in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-20-2007, 05:55 PM
  4. appending the columns of diifferent sheets and finding difference
    By dvrkrishna in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-05-2007, 10:37 AM
  5. Replies: 15
    Last Post: 05-01-2007, 04:47 PM

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