+ Reply to Thread
Results 1 to 14 of 14

SUM the cells between two cells with zeros (from formula) in a column, multiple occurances

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    SUM the cells between two cells with zeros (from formula) in a column, multiple occurances

    I have a column of numbers (results from formulae) for which I would like to return SUMs for the values between randomly spaced zero values.
    If this is not possible, I could have null values (#VALUE!) rather than zeroes. (But I'd like to hide any #VALUE! from displaying/printing)

    This is very similar to the thread: Macro to SUM the cells between two blank cells in a column, multiple occurances

    link: http://www.excelforum.com/excel-prog...ccurances.html

    example:

    100
    23
    2 125
    0
    47
    52 99
    0
    2347.5
    28 2375.5
    0

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Try this

    =IF(Q14<>0,SUM(R13:R13,Q14),0)

  3. #3
    Registered User
    Join Date
    12-10-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Hi Bob, Thanks..! Close, but I'd also like it to leave the intermediate subtotals blank. If I don't see any replies that can do that, I may end up using it. I do like the fact that your solution is a formula rather than a macro, but for this instance, I'm thinking it will very likely require a macro. Best Regards, Carl

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    No, just adjust to

    =IF(Q14<>0,SUM(R13,Q14),"")

  5. #5
    Registered User
    Join Date
    12-10-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Hi Bob, Hmmm... That ignores text well, (apparently in this instance Excel does return a zero for text) and also gives me a very nice blank...
    But, I can make the zeros not visible (and won't print) from TOOLS, OPTIONS, & uncheck Zero Values.
    However, it still doesn't give me a blank (or a zero which I could hide) before the totals... I used to be great at HP basic... that had IF, THEN, OR, ELSE, and ELSEIF, but excel doesn't which throws me off my game here... Maybe a nested IF... (but I usually get bad results from trying that...) But it does give me a few ideas... I'll try a few more things... Thanks again!!!

  6. #6
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    I'm missing something, which cells are not showing as you would want, and in what way?

  7. #7
    Registered User
    Join Date
    12-10-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Hi Bob, Thank you so much for your time and effort! OK... I hope this makes sense...
    Q13 is text (should evaluate to zero) Q14 is 12.4, Q15 is 2.3 and Q16 is zero.
    I need to check Q13 through Qn to check for valid numbers until it finds zeros at both ends (Q16 in this case) and add all the valid numbers
    (Q14 to Q15) in R15 (Rn), but leave out the valid number for Q14 from R14. Plain as mud eh? The first formula you gave worked perfect, except for populating R14 (and since I'm using the formula for every line in column R) and R17) I could do this in hp basic, which is why it's making feel like a dummy trying to do it in Excel. Anyhow thanks! you're a saint! I'm outta here in 15, so please don't spend too much time on it, unless the puzzle has you hooked!

  8. #8
    Registered User
    Join Date
    12-10-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Oh BTW... stanleydgromjr had a near solution in the post: http://www.excelforum.com/excel-prog...ccurances.html except it didn't like to pull the numbers from formulas...

  9. #9
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    C.L.Garthwaite,

    Thanks for the Private Message.

    The majority of the cells in your attached workbook can NOT be clicked into??????

    Please remove any protection from the workbook, and, repost it.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  10. #10
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Why don't you post the workbook with the values in column R that you want to get, I'm sure it will be simple then.

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,554

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Try this
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-10-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    Hi Jindon, Perfect! Exactly what I needed! Thanks a million! Best regards, Carl

  13. #13
    Registered User
    Join Date
    12-10-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    I want to thank Everyone who looked at this post and gave suggestions for their time and effort.
    PM me if any of you need any AutoCad 2000-2008 help!

  14. #14
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: SUM the cells between two cells with zeros (from formula) in a column, multiple occura

    C.L.Garthwaite,

    Thanks for the feedback.

    You are very welcome. Glad we could help.

    And, come back anytime.

+ 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] Macro to SUM the cells between two blank cells in a column, multiple occurances
    By importriders in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-28-2013, 08:39 AM
  2. [SOLVED] Count occurances based on very specfic criteria from multiple cells (excel 2003)
    By Ash Ford in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-10-2013, 09:02 AM
  3. [SOLVED] How do I get the average across multiple cells not in a range and not count the zeros/text
    By sponge_designs in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2013, 03:05 AM
  4. Replies: 5
    Last Post: 05-11-2012, 03:38 AM
  5. Filter column with cells with leading zeros
    By erktp in forum Excel General
    Replies: 2
    Last Post: 08-24-2011, 02:21 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