+ Reply to Thread
Results 1 to 12 of 12

countif or sumproduct?

  1. #1
    Registered User
    Join Date
    09-16-2014
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    30

    countif or sumproduct?

    Hello,
    Not sure if this requires a formula. Column M (highlighted) is the final CORRECT and desired answer and counts the number of times taxis arrive before the time in column B. For example, 3 means that 3 taxis arrived before 6:57.

    Here is what I did,
    Original in column A, sort to get column E (note: there are ones that not ideal for sort sometimes if its in a different format). Ideally Id exact the time only.
    Get column I, its sorted and runs into the next day. Count manually how many times events have occurred before column L.

    So basically I am trying to count the number of times taxis arrive (see the sheet attached).
    Again, I need to count the number of times it arrived before 6:57 (30 minutes from the starting time 6:27), which is M2 (3 times).
    However, column A is not in the format desired and also runs into the second day 5/24/2011 and 5/25/2011.

    Can you help with a function that gets to column M? Thanks!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: countif or sumproduct?

    Apply the below formulas to extract the date and time and then arrive your req

    Formula: copy to clipboard
    Please Login or Register  to view this content.




    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  3. #3
    Registered User
    Join Date
    09-16-2014
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    30

    Re: countif or sumproduct?

    Hi, I get 0.5465 and 40268 when I enter your formula...
    Can you attach the excel?

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: countif or sumproduct?

    You also need to extract the date from column E.

    I made an pivot table of 1 day.

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: countif or sumproduct?

    Quote Originally Posted by yinxzon View Post
    Hi, I get 0.5465 and 40268 when I enter your formula...
    Can you attach the excel?
    Maybe you just need to format the cells. In Excel dates and times are really just numbers formatted to look like dates/times for our human consumption.

    0.5465 formatted as Time = 1:06:58 PM

    40268 formatted as Date = 3/31/2010
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    09-16-2014
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    30

    Re: countif or sumproduct?

    thanks for that oeldere, but its not working, even if i add 14+11= its not 30.
    column M is correct and if i drag your column i and j your second day doesnt work...

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: countif or sumproduct?

    No longer interested in following the problem.
    Last edited by newdoverman; 09-18-2014 at 12:13 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Registered User
    Join Date
    09-16-2014
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    30

    Re: countif or sumproduct?

    Hi there, for some reason, your date function is wrong because there is only 5/24 and 5/25 and in your column d has 5/27 and 5/28.
    My column M is 100% correct.
    I attached what Tony and Oeldere asked me to do, but I am only at the date and time (column o and p).

    Here is the formula that I thought would work suggested by shg but I dont know how to combine it with my new format...
    c1: =sumproduct(--(text($d$1:$d$69, "0\:00") - b1 <= 0))
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: countif or sumproduct?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Then explain why this result in M2 = 3 (as I expect there the result 5) => see the pivot table.

  10. #10
    Registered User
    Join Date
    09-16-2014
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    30

    Re: countif or sumproduct?

    oldere, your answer is correct up to group 6 bc the next answer is 30 not 11+14=25..
    if you count the number of times taxis show up before 9:27 you should count 30.
    something is wrong there and also your pivot table requires manual work and different sheets it seems like whereas =sumproduct(--(text($d$1:$d$69, "0\:00") - b1 <= 0)) something like that is just one formula.. i have to do this to many many sheets of raw data so i prefer shg's method but he is MIA lately.

  11. #11
    Registered User
    Join Date
    09-16-2014
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    30

    Re: countif or sumproduct?

    help anyone?
    Last edited by yinxzon; 09-18-2014 at 09:10 PM.

  12. #12
    Registered User
    Join Date
    09-16-2014
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    30

    Re: countif or sumproduct?

    i dont see how m2 could be 3, if its 5 you must be including events from the next day.

+ 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. Use of SUMPRODUCT/COUNTIF?
    By mfiery in forum Excel General
    Replies: 3
    Last Post: 05-18-2009, 05:50 AM
  2. Sumproduct? Countif?
    By windme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2008, 04:28 PM
  3. countif or sumproduct?
    By Darlo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-20-2007, 09:06 AM
  4. SUMPRODUCT or COUNTIF??
    By KirstieA in forum Excel General
    Replies: 1
    Last Post: 07-27-2005, 07:06 AM
  5. countif or sumproduct
    By cape in forum Excel General
    Replies: 1
    Last Post: 02-02-2005, 01:12 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