+ Reply to Thread
Results 1 to 12 of 12

How to total values for days separated by empty cells

  1. #1
    Forum Contributor
    Join Date
    04-01-2014
    Location
    Middle east
    MS-Off Ver
    Excel 2003 /2007/2010
    Posts
    169

    How to total values for days separated by empty cells

    Help!
    How to sum values for several days provided that days are separated by blank cells.

    a file is attached for explanation.

    thank you
    Attached Files Attached Files

  2. #2
    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,152

    Re: How to total values for days separated by empty cells

    Why not ...

    =(SUMPRODUCT((K$8:K$27>=B8)*(K$8:K$27<=C8)*(L8:L27)))

  3. #3
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: How to total values for days separated by empty cells

    If you always have an entry for every day you could use something like

    Please Login or Register  to view this content.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  4. #4
    Forum Contributor
    Join Date
    04-01-2014
    Location
    Middle east
    MS-Off Ver
    Excel 2003 /2007/2010
    Posts
    169

    Re: How to total values for days separated by empty cells

    sorry, but the result is not true!
    did you try it ?

  5. #5
    Forum Contributor
    Join Date
    04-01-2014
    Location
    Middle east
    MS-Off Ver
    Excel 2003 /2007/2010
    Posts
    169

    Re: How to total values for days separated by empty cells

    Quote Originally Posted by JohnTopley View Post
    Why not ...

    =(SUMPRODUCT((K$8:K$27>=B8)*(K$8:K$27<=C8)*(L8:L27)))
    sorry, but the result is not true!
    did you try it ?

  6. #6
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: How to total values for days separated by empty cells

    I'd prefer to fix the problem at the source and make sure the data always has the date next to it that corresponds to it.

    Maybe it is created from a pivot table where you can tell it to fill all the headers/dates in or maybe you just need a column next to it that goes "if there is a date then take that date if not use the cell above" - and just fill it down then you can use all the normal formulas pivot tables and so forth on your data.

  7. #7
    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,152

    Re: How to total values for days separated by empty cells

    Sorry .. misunderstood (dumb me!): need SUM with OFFSET or INDEX.


    =SUM(INDEX(L8:L27,MATCH(B8,K8:K27,0)):INDEX(L8:L27,MATCH(C8,K8:K27,0)))

    OR

    =SUM(OFFSET($K$7,MATCH(B8,K8:K27,0),1,MATCH(C8,K8:K27,0)-MATCH(B8,K8:K27,0)+1))
    Last edited by JohnTopley; 07-17-2017 at 02:34 AM.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to total values for days separated by empty cells

    Maybe:

    =SUMPRODUCT(FREQUENCY($K$8:$K$27,$H$8:$H$27),--($H$8:$H$28>=$B$8),--($H$8:$H$28<=$C$8),$L$8:$L$28)
    Dave

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

    Re: How to total values for days separated by empty cells

    What is your expected result in this case and why
    Samba

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

  10. #10
    Forum Contributor
    Join Date
    04-01-2014
    Location
    Middle east
    MS-Off Ver
    Excel 2003 /2007/2010
    Posts
    169

    Re: How to total values for days separated by empty cells

    Quote Originally Posted by JohnTopley View Post
    Sorry .. misunderstood (dumb me!): need SUM with OFFSET or INDEX.


    =SUM(INDEX(L8:L27,MATCH(B8,K8:K27,0)):INDEX(L8:L27,MATCH(C8,K8:K27,0)))

    OR

    =SUM(OFFSET($K$7,MATCH(B8,K8:K27,0),1,MATCH(C8,K8:K27,0)-MATCH(B8,K8:K27,0)+1))
    Both are working. Big thanks
    BUT! when you choose the period From- To it did't include all the values of the TO date, it sums up to the first value of the TO date.
    How can we fix this?

  11. #11
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: How to total values for days separated by empty cells

    maybe this is more robust
    Please Login or Register  to view this content.
    of course change the 27's to be 1000 or whatever if your list gets longer the 8 is the start row the 7 is the start row -1

  12. #12
    Forum Contributor
    Join Date
    04-01-2014
    Location
    Middle east
    MS-Off Ver
    Excel 2003 /2007/2010
    Posts
    169

    Re: How to total values for days separated by empty cells

    Quote Originally Posted by scottiex View Post
    maybe this is more robust
    Please Login or Register  to view this content.
    of course change the 27's to be 1000 or whatever if your list gets longer the 8 is the start row the 7 is the start row -1
    Great!
    Appreciation

+ 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] need vba help to sum the overall total ,>2 days total & change cell values
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-17-2014, 01:55 PM
  2. [SOLVED] Export Data in Rows, Separated by Empty Cells to Text Files
    By leoxanigm in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-16-2014, 09:53 AM
  3. Replies: 3
    Last Post: 12-23-2013, 12:32 PM
  4. Replies: 2
    Last Post: 07-25-2013, 01:01 PM
  5. [SOLVED] Flag cells that are empty after 90 days
    By SpiritedAway in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-11-2013, 03:01 PM
  6. [SOLVED] Add Values From Non-Working Days to Monday Total
    By ddavelarsen in forum Excel General
    Replies: 2
    Last Post: 10-02-2012, 10:15 AM
  7. Loop through groups of rows separated by empty cells
    By wmbower in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2012, 02:53 PM
  8. Need to total ranges of numbers separated by empty cells
    By iturnrocks in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2009, 12:06 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