+ Reply to Thread
Results 1 to 4 of 4

Sum product using time range

  1. #1
    Registered User
    Join Date
    02-17-2008
    Posts
    51

    Sum product using time range

    Hi everyone,

    I need your help!

    I have a table that shows the Code, Time From and Time To columns. When a code is found, I would like a value to return when the data is between the Time From and Time To fields using the sumproduct. See below to explain myself more.

    1st data
    Code - A
    Time From - 08:00
    Time To - 08:10

    2nd data
    Code A
    Time From - 08:30
    Time To - 08:50

    The result should be the following:
    Time - Result
    08:00 - 1
    08:05 - 1
    08:10 - 1
    08:15 - 0
    08:20 - 0
    08:25 - 0
    08:30 - 1
    08:35 - 1
    08:40 - 1
    08:45 - 1
    08:50 - 1
    08:55 - 0

    Is this douable? Your help on this is appreciated!

    Statsman

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =SUMPRODUCT(--($A$1:$A$3<>""),--($B$1:$B$3<=A5),--($C$1:$C$3>=A5))

    Where A1:C3 contains your data and A5 first time in Results table... adjust ranges to suit and copy formula down.
    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
    05-26-2008
    Posts
    122
    it should be...

    change cell properties to time:
    then..

    this is the forumla using cells as references for restictions
    A4=8:10
    A5=8:15
    B4=8:30
    B5=8:50

    b8 is where u wud type the value to be checked

    =IF(OR(AND($B8>=$A$4,$B8<=$A$5),AND($B8>=$B$4,$B8<=$B$5)),1,0)

    and fill down

    that oughta get u going

  4. #4
    Registered User
    Join Date
    02-17-2008
    Posts
    51

    Sum product using time range

    Thanks everyone! The sumproduct works great!

+ 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. Subscript out of range error when using nested if statement
    By bradshaw in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-30-2008, 11:39 AM
  2. Check value in a time range
    By badin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-25-2008, 06:31 PM
  3. Resetting Spreadsheet Data Entry Cells
    By acg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2007, 02:08 PM
  4. Date and Time Graphs
    By sach0025 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 03-10-2007, 01:07 AM
  5. Time and Conditional Formatting Problem
    By jonhunt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-31-2006, 01:35 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