+ Reply to Thread
Results 1 to 7 of 7

Averaging with empty cells

  1. #1
    Registered User
    Join Date
    03-14-2016
    Location
    Manchester, NH
    MS-Off Ver
    2010
    Posts
    4

    Averaging with empty cells

    I have a worksheet that calculates the number of days between when we received a customer return in versus the date we sent back to the customer. The first part of my question is why I am getting a large negative number as a result. (I think I need to filter out using an IF statement) My second question is I need to be able to include in my average the items not yet sent back otherwise I am misstating my average. Any help would be appreciated.
    Attached Files Attached Files
    Last edited by Monicalemaire; 03-14-2016 at 11:43 AM. Reason: added file

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Averaging with empty cells

    Monica,

    If you can attach a sample from your worksheet, just enough data to show what it IS doing, and a note or "dummy set" of numbers showing what you WANT it to do, it would be a real help,

    Ochimus

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Averaging with empty cells

    Sorry- something odd there, as my machine never showed your attachment at first. Apologies.

    Ochimus

  4. #4
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Averaging with empty cells

    Monica,

    The "negative" number is because you are taking date number in Col B from "Zero" (no number) in Col C.

    Formula in Col D needs to exclude any rows without a date: Put this in D3 and copy down as many rows as you want.

    =IF(C3="","",DAYS360(B3,C3))

    And put this in D8 - it will ignore the blanks.

    =AVERAGE(D3:D5)

    Ochimus
    Last edited by Ochimus; 03-14-2016 at 11:57 AM.

  5. #5
    Registered User
    Join Date
    03-14-2016
    Location
    Manchester, NH
    MS-Off Ver
    2010
    Posts
    4

    Re: Averaging with empty cells

    I fixed the formula to make the date outs blank however that makes my average 4 days which doesn't account for the two that have not been sent back out. How do I include these into the equation?

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Averaging with empty cells

    If you haven't a "Date Out" how can you average it?

  7. #7
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Averaging with empty cells

    Monica,

    More apologies, as I misunderstood what you wanted to show in the "average"

    Try the attached. Col D checks whether the item is still in stock (no date on Col C).
    If there is no date, it gives the number of days between receiving the product (Col B) and today:
    If there is a date, D3 stays blank.

    =IF(C3<>"","",TODAY()-B3)

    Col E then checks if you have returned the items (date in Col C).
    If there is a date in Col C it calculates the number of days between receiving it and returning it.
    If there is no date in Col C, E3 remains blank.

    =IF(C3="","",DAYS360(B3,C3))

    Copy those down as many rows as you want.

    H2 then calculates the averaga as "total days you have held the current stock" (Col D) + "total days before you returned items" (Col E), divided by "number of items in Col B":

    =ROUNDDOWN((SUM(D:D)+SUM(E:E))/COUNT(B:B),0)

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 03-14-2016 at 12:32 PM.

+ 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] 8 Columns with empty cells -> 1 Column without empty cells -> Problem: 1st value ignored
    By chrisignm in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-23-2015, 04:50 AM
  2. [SOLVED] Telling my macro to ignore empty cells when averaging
    By duhigs in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-23-2014, 03:06 AM
  3. How to keep an averaging cell empty until all the input cells are filled
    By troyer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-29-2013, 11:02 AM
  4. [SOLVED] Error when averaging empty & non empty cells
    By simonlblea in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2013, 09:04 AM
  5. Averaging with empty cells
    By benjamings in forum Excel General
    Replies: 2
    Last Post: 08-05-2010, 05:14 PM
  6. #DIV/0! Error when Averaging empty cells
    By Lungfish in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-25-2008, 08:00 AM
  7. #DIV/0! Error when Averaging empty cells
    By Lungfish in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2008, 07:43 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