+ Reply to Thread
Results 1 to 14 of 14

Function that identifies specific time values and then sums adjacent cells

  1. #1
    Registered User
    Join Date
    12-12-2014
    Location
    Dorset, England
    MS-Off Ver
    Excel 2013
    Posts
    54

    Function that identifies specific time values and then sums adjacent cells

    Good Morning Everybody,

    It's that time again when I need your help please. Here's an overview of the challenge:


    1. A standard worksheet where, in column A, there are 60 time entries from cells A2 to A61.

    2. Each time entry contains the hour and minute values (i.e., 11:08, 11:09, 11:10 etc.)

    3. Next to each of the cells in column A, there is number data only in column B. There are no blank cells or errors in any of the cells.


    What I would like to be able to do is as follows:

    a) At intervals where the times in column A are exactly divisible by 5 (i.e., 11:05, 11:10, 11:15 etc.), I need the function to sum the previous 5 entries in column B. For example:

    Cell# Column A Column B
    A7 11:06 56
    A8 11:07 200
    A9 11:08 314
    A10 11:09 -41
    A11 11:10 78

    b) The function should then automatically calculate the sum total as =SUM(B7:B11) as it should recognise that cell A11 contains a time value divisible by 5.

    c) The function should be inserted into cell B70 and the sum value should then appear in cell B70.

    Many thanks in advance for your help. I haven't yet attached a template but am happy to do so if it helps.

    Kindest regards,

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: Function that identifies specific time values and then sums adjacent cells

    Hi there. Is this what you had in mind?
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Function that identifies specific time values and then sums adjacent cells

    Please attach sample file with expected result
    What your expected result in B
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    12-12-2014
    Location
    Dorset, England
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Function that identifies specific time values and then sums adjacent cells

    Hi Glenn,

    Sorry for my delayed response, I have just downloaded the file.

    Thanks very much!

    The only detail I neglected to mention is that the time values are part of a DDE data feed, and they populate cells A2 to A61 in continuous rotation (i.e., data feeds in starting at A2, and when cell A61 is populated, all other new entries push the data up, erasing the older values in cell A2).

    This means that the time values divisible by 5 are also continuously pushed up, and I would like to be able to track the adjacent sum values accordingly. Is there a way of amending the function?

    Thanks again for all your help!

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Function that identifies specific time values and then sums adjacent cells

    please attach sample excel file with expected result

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194
    That should be OK. I'm away right now; so look back a little later.

  7. #7
    Registered User
    Join Date
    12-16-2014
    Location
    Amsterdam, Nederland
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Function that identifies specific time values and then sums adjacent cells

    Hi,

    Try this one.

    Bas

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: Function that identifies specific time values and then sums adjacent cells

    OK. I had tried to take a shortcut... and you caught me out!!. Try this. You can hide the helper column.
    Attached Files Attached Files

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: Function that identifies specific time values and then sums adjacent cells

    I should have added... the first total is ALWAYS the first complete 5 minute period.

  10. #10
    Registered User
    Join Date
    12-12-2014
    Location
    Dorset, England
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Function that identifies specific time values and then sums adjacent cells

    Hi Glenn,

    Fantastic, I've just had a look and that's perfect. Thanks for all your help!

  11. #11
    Registered User
    Join Date
    12-12-2014
    Location
    Dorset, England
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Function that identifies specific time values and then sums adjacent cells

    Hi Bas,

    Thanks so much for taking a look at this. Your solution works really well, and I will also be able to use this.

    All the best!

  12. #12
    Registered User
    Join Date
    12-12-2014
    Location
    Dorset, England
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Function that identifies specific time values and then sums adjacent cells

    Hi,

    Thanks for having a look at this, but the problem's been solved.

    Warm regards!

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: Function that identifies specific time values and then sums adjacent cells

    Glad to have helped! If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

  14. #14
    Registered User
    Join Date
    12-12-2014
    Location
    Dorset, England
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Function that identifies specific time values and then sums adjacent cells

    Hi Glenn,

    sure thing, will do. Have a great evening.

+ 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] Counting Specific Text Occurences in Cells Adjacent to Particular Values
    By lowlybroker in forum Excel General
    Replies: 7
    Last Post: 10-21-2013, 12:07 PM
  2. [SOLVED] Search Function used to fill in Values of adjacent cells
    By BrettW in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2013, 04:30 PM
  3. Replies: 7
    Last Post: 12-04-2012, 06:23 AM
  4. [SOLVED] Calculating sums, referring to adjacent cells
    By theletterh in forum Excel General
    Replies: 3
    Last Post: 05-18-2012, 04:10 PM
  5. Replies: 2
    Last Post: 06-23-2009, 03:27 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