• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Find Empty Cell and Sum Cells Above

Kenshin

Member
Please need help for this case, hope get the answer


thank in advanced
 

Attachments

  • Ask Help.xlsx
    11.7 KB · Views: 21
Code:
Option Explicit

Sub AskHelp()
    Dim c As Range, rng As Range
    Dim lr As Long, x As Long
    lr = Range("E" & Rows.Count).End(xlUp).Row
    Set rng = Range("E3:E" & lr + 1)
    x = 0
    For Each c In rng
        If c <> "" And c.Offset(0, -1) <> "" Then
            x = x + c
        ElseIf c = "" Then
            c = x
            x = 0
        End If
    Next c
End Sub
 
try this formula in G6 and drag down
Code:
=IFERROR(SUMPRODUCT(E3:E6,D3:D6^0),"")
 

Attachments

  • Ask Help_salim.xlsx
    16.7 KB · Views: 13
Thanks Bosco, but could you revise your formula so i can use it on column E? And combine with my formula on Clumn E which is on E3 and go down = C3*D3?

thank you so much
 

Attachments

  • Ask Help.xlsx
    11.3 KB · Views: 2
Back
Top