+ Reply to Thread
Results 1 to 20 of 20

Sum only IF a cell has value but have it be cumulative if the previous cell is blank

  1. #1
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Hello,

    I would like to have a formula in Column B which only shows a value if column A has a value (other than 0) but would like Column B to be cumulative.

    For example if in Column A, lines 13,14,15,16 are zero but line 17 in Column A has a value, then in column B line 17 would be my value in C1 times 5 (to account for lines 13,14,15,16, and 17).

    I tried creating a formula with IF statements which I have attached but I only accounted for three zeroes in Column A, I would like to see if there is a range formula or a more simplistic formula for this.

    Thank you.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    If A is a Blank
    Please Login or Register  to view this content.
    If A = 0 or is blank
    Please Login or Register  to view this content.
    I know I'm not stupid, but I suspect I'm a lot stupider than I think I am

  3. #3
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Thanks for the reply but I don't want to take the sum column A. I only want to the sum of column A until the last value above zero and then multiplied by C1, so it would look something like this. Assume C1 = 2.

    Column A Column B
    0 0
    5 4
    0 0
    3 4
    0 0
    0 0
    0 0
    0 0
    0 0
    6 12

  4. #4
    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
    43,964

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Please amend your ORIGINAL sheet, to show an EXTRA column with manually calculated results.
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Try this in B2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    I don't understand your explanation with your example. The last value above zero in A is 6, multiplied by 2 is 12,so I get that part. But I don't understand the 4's in column B.

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    I think in your example spreadsheet you need to post what values you would like the formula to produce. Then we can write a formula to do it. Switching between an example attached sheet that should be showing what you want and then text in the conversation, is not conducive to getting an answer.

  8. #8
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Please find the revised file attached.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    This is good, thank you! However it doesn't work in B1 and B2.

    What do the 14, 6 represent?
    Last edited by gfl0101; 01-31-2018 at 12:29 PM.

  10. #10
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    See this formula in B2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Comments:
    In the AGGREGATE function 14 means Greater and 6 means to ignore errors.

    This function gives you the row of the las non zero after the row you have the formula
    Last edited by José Augusto; 01-31-2018 at 12:40 PM. Reason: Add comments

  11. #11
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    if you can live with an extra line at the top the attached array formula works
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Thank you all!
    Could you please check the formula in cell E11, it should be 2 not 22, not sure what I am doing work. Thanks.
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    2 or 4

    my formula wants a value in e9 or e10 depending on what you require, hence the extra line. it searches for the previous non 0 row

  14. #14
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    sorry my typo, correct 4 not 2.

  15. #15
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    I added another condition, if you could please take a look at the attachment. Thank you.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    bump..just need help fixing the 22 instead of 4 issue. The other condition does need to be taken into consideration anymore. thanks

  17. #17
    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
    43,964

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Try adding any text as a header at K9. It took a while to track it down!!
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    12-20-2017
    Location
    new york, new york
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    Solved, thank you very much Glenn!

  19. #19
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    HI @gfl0101

    In @davsth and @José Augusto solutions you must have headers in C9 and E9.

    See the file
    Attached Files Attached Files

  20. #20
    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
    43,964

    Re: Sum only IF a cell has value but have it be cumulative if the previous cell is blank

    You're welcome.



    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 all members who helped you reach a solution.

+ 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. Display blank cell if previous cell is blank in formula
    By Brent951 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-29-2016, 03:34 PM
  2. Replies: 1
    Last Post: 07-22-2016, 04:03 PM
  3. How to autofill row A with previous date at the first blank cell using VBA
    By Omarbo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2016, 07:37 PM
  4. [SOLVED] Find certain word, copy and paste cell in previous row if previous row is blank
    By steven_e in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 12:53 PM
  5. fill next blank cell from one cell w/o changing previous cells
    By doodle72 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-07-2013, 12:35 PM
  6. Replies: 1
    Last Post: 04-30-2012, 06:02 AM
  7. Replies: 3
    Last Post: 04-25-2012, 12:56 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