+ Reply to Thread
Results 1 to 5 of 5

Calculate avg difference between dates omitting calculation if certain fields are blank

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Victoria, TX
    MS-Off Ver
    Excel 2010
    Posts
    28

    Calculate avg difference between dates omitting calculation if certain fields are blank

    I am trying to calculate the total average difference between dates, but I want to omit including it in the calculation if certain fields are blank. I feel like I should be able to figure this out, but I have tried everything I can think of. I have attached a very basic sample worksheet due to most of the data being confidential. Basically, I have a "Date Sent for Approval" column and a "Date Closed" column. When I send something for approval I enter the date in the "Date Sent for Approval" column. When it is approved and closed I enter the date in the "Date Closed" column. The problem is that I also have instances where both columns are blank, date closed is blank (because its still pending), or the date sent for approval is blank (because we closed it immediately without approval needed). I don't want any of those previous instances to affect my average calculation. I would like to be able to have on my dashboard a box that says "Days to Close" with the average of the difference between the "Date Closed" and "Date Sent for Approval"

    Thank you,
    Brooke
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,417

    Re: Calculate avg difference between dates omitting calculation if certain fields are blan

    Are you still using Excel 2010?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Calculate avg difference between dates omitting calculation if certain fields are blan

    The most straightforward way to do this would be to use a helper column and then take the average of that helper column.

    For example, you can put this in C2:
    =IF(COUNT(A2:B2)=2,B2-A2,"")
    Drag down column C

    Then this will give you the average:
    =AVERAGE(C:C)

    I noticed that you used a difference of 1 day in you manual average for 9/22 - 9/22.
    This is a difference of 0 days.

    If you want those to show as 1, you can modify the helper column to this:
    =IF(COUNT(A2:B2)=2,IFERROR(1/(1/(B2-A2)),1),"")

  4. #4
    Registered User
    Join Date
    10-22-2013
    Location
    Victoria, TX
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Calculate avg difference between dates omitting calculation if certain fields are blan

    No. Microsoft 365. This was a spreadsheet that was created way before me. I haven't updated because they have some weird formulas and such in here that I don't want to mess up. I have added columns, but that's it. I am going to redo the whole spreadsheet at the start of the year.

  5. #5
    Registered User
    Join Date
    10-22-2013
    Location
    Victoria, TX
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Calculate avg difference between dates omitting calculation if certain fields are blan

    You're right about the 1 day in the manual. Allergy medicine has made me foggy.

+ 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. [SOLVED] Simple difference calculation from time stamp does not calculate?
    By Cedric Wyckmans in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2018, 05:31 AM
  2. [SOLVED] Calculation of dates and leaving blank cell when calculation sees non-date values
    By Hedy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-22-2018, 07:52 AM
  3. Difference in Dates Calculation
    By bdav1216 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-18-2017, 10:05 AM
  4. [SOLVED] Max and Min value between 2 dates omitting zeros and blank
    By Sekars in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2016, 04:10 AM
  5. Ignore Blank Fields in Calculation
    By Tywynn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-09-2015, 02:56 PM
  6. Replies: 1
    Last Post: 10-19-2012, 02:08 PM
  7. Accurate calculation of the difference between two dates
    By marcyspark in forum Excel General
    Replies: 30
    Last Post: 09-02-2011, 10:08 AM

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