+ Reply to Thread
Results 1 to 6 of 6

Sumproduct Formula Not Working Consistently - Date Issue

Hybrid View

  1. #1
    Registered User
    Join Date
    04-05-2007
    Location
    Lombard, Illinois
    Posts
    60

    Sumproduct Formula Not Working Consistently - Date Issue

    I'm trying to build a spreadsheet that will eventually calculate the average occupancy rate based on periods of time. Eventually I would like the average occupancy for all objects, per hour, the average occupancy of all objects from 9 AM to 12 PM, etc. I started by using Sumproduct to find the occupancy per 15 minute period which is the smallest time period of the data. There is only one row in the data for each object and each 15 minute time period.

    The problem I'm having is the Sumproduct formula works about half the time. The other half are not getting any results. I've tried a few things, including formatting the data the same, splitting the date and time into seperate columns. I get the same results and it is always the same rows that give no results. I can get results on the rows that previously didn't get results if I manually type the date and time into the hour worksheet.

    I just don't understand why some work and some don't. I've attached the spreadsheet. The cells with zero are the ones not working, specifically 1:45 AM, 2:30 AM, and 4:45 AM are three examples.

    Anyone have any thoughts.
    Attached Files Attached Files
    Last edited by gav0101; 09-18-2008 at 11:47 AM.

  2. #2
    Registered User
    Join Date
    04-05-2007
    Location
    Lombard, Illinois
    Posts
    60
    Sorry about that. I didn't realize the attachment was too big and didn't attach. I stripped off a bunch of the data so it would fit.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    It has to do with the precision in Excel's calculation... the formula result you have is not exactly the same as the date translation Excel uses.

    Try this, in C5, to get better accuracy:

    =SUMPRODUCT--(ROUND(Data!$A$2:$A$1326,6)=ROUND($A5,6)),--(Data!$D$2:$D$1326=C$4),(Data!$N$2:$N$1326))

    copied down and across the table.
    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.

  4. #4
    Registered User
    Join Date
    04-05-2007
    Location
    Lombard, Illinois
    Posts
    60
    Thanks NBVC. I kind of figured it had something to do with the formula and the seconds.

    Is the ",6" in the round function saying round the number to the sixth position in this case seconds. If yes, I would think I should round to the 4th position in this case minutes, because I won't have any seconds in the data.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    No the 6 doesn't mean that...

    Excel stores date/time as actual numbers... where the date is the part before the decimal and the time is everything after the decimal...

    So I just round the whole time to 6 decimals..which should change the end result.

  6. #6
    Registered User
    Join Date
    04-05-2007
    Location
    Lombard, Illinois
    Posts
    60
    Thanks again.

+ 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. Formula return following Wednesday or Friday date.
    By mikeburg in forum Excel General
    Replies: 11
    Last Post: 06-30-2010, 02:04 PM
  2. pasting formula issue - working with multiple sheets
    By misteremanca in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-17-2008, 04:58 PM
  3. IF= formula date issue
    By jendew in forum Excel General
    Replies: 13
    Last Post: 05-12-2008, 03:17 PM
  4. Issue with Formula
    By oliver79 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-21-2008, 08:58 AM
  5. Sumproduct formula - how to put the criteria together
    By Darlo in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-27-2007, 08:17 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