methuselah
methuselah

Reputation: 13206

Convert COUNTIFS to SUMIFS

I currently have a formula which counts the number of rows that meet a particular condition in my spreadsheet.

=COUNTIFS(E:E,"<>",F:F,">="&TODAY())

As there are numbers within these rows, how do I count the value in them instead?

I've tried

=SUMIFS(E:E,"<>",F:F,">="&TODAY())

but Excel tells me I have not entered enough arguments, what am I missing?

Upvotes: 0

Views: 1142

Answers (2)

user4039065
user4039065

Reputation:

To sum E:E based on the criteria in a countifs simply replace =countifs( with =sumifs(e:e,.

Sub sumifsCountifs()
    Dim fnd As Range, parm As Variant, tmp As String

    With Worksheets("sheet6")
        .Cells.Replace What:="=countifs(", Replacement:="=sumifs(e:e,", LookAt:=xlPart, _
                       SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False
    End With
End Sub

Upvotes: 0

Alexandru Cimpanu
Alexandru Cimpanu

Reputation: 1069

This is what I used to add the values of the rows that have the date greater or equal to today's date: =SUMIFS(A2:A32,A2:A32,">="&TODAY())

And to count the days greater or equal to today's date you can use =COUNTIFS(A2:A32,">="&TODAY())

Is this what you are trying to do?

Upvotes: 1

Related Questions