SUMIF FUNCTIONS based on a number of criteria

Rochelle187

New Member
Joined
Jan 23, 2012
Messages
3
I'm after some help on quite a complex formula I think...

I have a spready that in worksheet 1 states all reciepts with in column A the account name, column F the sum of payment, column G the month paid.

In the additional worksheets I have the totals for each month by account name i.e payment, food, rent etc

I am after a formula based a number on scenarios the result in the total for that account by month.

This is completely wrong but I hope you get the jist..
SUMIF
Range=Reciepts!A5:A28
Criteria=Payroll
&
Range=Month paid!G5:G28
Criteria=Jan 12
then show
Sum of total "INVOICE PAID!F5:F28 for those cells that meet the criteria

I hope you can help, i've been trying for weeks :confused:
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
In Excel 07/10 you can use SUMIFS() or in Excel 03 SUMPRODUCT().
Can you post sample of data?


ou can download and install two of the following programs:

HTLMaker

or
Excel Jeanie


or when using Internet Explorer just put borders around your data in Excel and copy those cells into your post.
 
Upvote 0
Thank you

This is a sample of the data, I would like to create new "account" pages within the workbook that totals the sum per month paid.

<TABLE style="WIDTH: 510pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=679 x:str><COLGROUP><COL style="WIDTH: 90pt; mso-width-source: userset; mso-width-alt: 5120" width=120><COL style="WIDTH: 95pt; mso-width-source: userset; mso-width-alt: 5376" width=126><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 4394" width=103><COL style="WIDTH: 68pt; mso-width-source: userset; mso-width-alt: 3840" width=90><COL style="WIDTH: 54pt; mso-width-source: userset; mso-width-alt: 3072" span=2 width=72><COL style="WIDTH: 72pt; mso-width-source: userset; mso-width-alt: 4096" width=96><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: #bccce4; WIDTH: 90pt; HEIGHT: 12.75pt; BORDER-TOP: silver 0.5pt solid; BORDER-RIGHT: silver 0.5pt solid" class=xl27 height=17 width=120>Account</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: #bccce4; WIDTH: 95pt; BORDER-TOP: silver 0.5pt solid; BORDER-RIGHT: silver 0.5pt solid" class=xl28 width=126>Supplier</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: #bccce4; WIDTH: 77pt; BORDER-TOP: silver 0.5pt solid; BORDER-RIGHT: silver 0.5pt solid" class=xl27 width=103>Invoice Date</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: #bccce4; WIDTH: 68pt; BORDER-TOP: silver 0.5pt solid; BORDER-RIGHT: silver 0.5pt solid" class=xl27 width=90>Invoice No</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: #bccce4; WIDTH: 54pt; BORDER-TOP: silver 0.5pt solid; BORDER-RIGHT: silver 0.5pt solid" class=xl29 width=72>Amount</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: #bccce4; WIDTH: 54pt; BORDER-TOP: silver 0.5pt solid; BORDER-RIGHT: silver 0.5pt solid" class=xl29 width=72>Inc VAT</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: #bccce4; WIDTH: 72pt; BORDER-TOP: silver 0.5pt solid; BORDER-RIGHT: silver 0.5pt solid" class=xl30 width=96>Month Paid</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Repairs & Maintenance</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>City Plumbing</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40890">13/12/2011</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22>12ao3860</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="93.31">£93.31</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="113.31">£113.31</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26>Pre-Startup EST</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Supplies</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>Cables fans & fittings ldt</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40911">03/01/2012</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 align=right x:num>97650</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="8.33">£8.33</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="10">£10.00</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26 align=right x:num="40909">Jan 12</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Supplies</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>B&Q</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40909">01/01/2012</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22> </TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="11.22">£11.22</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="13.46">£13.46</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26 align=right x:num="40909">Jan 12</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Car, Travel, Delivery</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>Esso</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40917">09/01/2012</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22> </TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="16.67">£16.67</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="20">£20.00</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26 align=right x:num="40909">Jan 12</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Food</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>Yosi's</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40919">11/01/2012</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22> </TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="8.4">£8.40</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="8.4" x:fmla="=SUM(E6)">£8.40</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26 align=right x:num="40909">Jan 12</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Payroll</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>Secret Pantry</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40916">08/01/2012</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22> </TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="100">£100.00</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="100" x:fmla="=SUM(E7)">£100.00</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26 align=right x:num="40909">Jan 12</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Food</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>Sainsburys</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40912">04/01/2012</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22> </TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="2.66">£2.66</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="2.66" x:fmla="=SUM(E8)">£2.66</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26 align=right x:num="40909">Jan 12</TD></TR><TR style="HEIGHT: 11.25pt" height=15><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver 0.5pt solid; BACKGROUND-COLOR: white; HEIGHT: 11.25pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22 height=15>Food</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; WIDTH: 95pt; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl24 width=126>Sainsburys</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl23 align=right x:num="40920">12/01/2012</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl22> </TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="9.18">£9.18</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl25 align=right x:num="9.18" x:fmla="=SUM(E9)">£9.18</TD><TD style="BORDER-BOTTOM: silver 0.5pt solid; BORDER-LEFT: silver; BACKGROUND-COLOR: white; BORDER-TOP: silver; BORDER-RIGHT: silver 0.5pt solid" class=xl26 align=right x:num="40909">Jan 12</TD></TR></TBODY></TABLE>
 
Upvote 0
Excel Workbook
ABCDEFGHIJKLM
1AccountSupplierInvoice DateInvoice NoAmountInc VATMonth PaidAccountjan-12feb-12
2Repairs & MaintenanceCity Plumbing13-12-1112ao386093,31113,31Pre-Startup ESTRepairs & Maintenance0,000,00
3SuppliesCables fans & fittings ldt3-01-12976508,3310,00jan-12Supplies23,460,00
4SuppliesB&Q1-01-1211,2213,46jan-12Car, Travel, Delivery20,000,00
5Car, Travel, DeliveryEsso9-01-1216,6720,00jan-12Food20,240,00
6FoodYosi's11-01-128,408,40jan-12Payroll100,000,00
7PayrollSecret Pantry8-01-12100,00100,00jan-12
8FoodSainsburys4-01-122,662,66jan-12
9FoodSainsburys12-01-129,189,18jan-12
Blad1
Cell Formulas
RangeFormula
L2=SUMPRODUCT(($A$2:$A$20=$K2)*($G$2:$G$20=L$1)*($F$2:$F$20))
L3=SUMPRODUCT(($A$2:$A$20=$K3)*($G$2:$G$20=L$1)*($F$2:$F$20))
L4=SUMPRODUCT(($A$2:$A$20=$K4)*($G$2:$G$20=L$1)*($F$2:$F$20))
L5=SUMPRODUCT(($A$2:$A$20=$K5)*($G$2:$G$20=L$1)*($F$2:$F$20))
L6=SUMPRODUCT(($A$2:$A$20=$K6)*($G$2:$G$20=L$1)*($F$2:$F$20))
M2=SUMPRODUCT(($A$2:$A$20=$K2)*($G$2:$G$20=M$1)*($F$2:$F$20))
M3=SUMPRODUCT(($A$2:$A$20=$K3)*($G$2:$G$20=M$1)*($F$2:$F$20))
M4=SUMPRODUCT(($A$2:$A$20=$K4)*($G$2:$G$20=M$1)*($F$2:$F$20))
M5=SUMPRODUCT(($A$2:$A$20=$K5)*($G$2:$G$20=M$1)*($F$2:$F$20))
M6=SUMPRODUCT(($A$2:$A$20=$K6)*($G$2:$G$20=M$1)*($F$2:$F$20))
 
Upvote 0
I will explain tomorrow how to use it.

Excel Workbook
ABCDEFG
1AccountSupplierInvoice DateInvoice NoAmountInc VATMonth Paid
2Repairs & MaintenanceCity Plumbing13-12-201112ao386093.31114,00Pre-Startup EST
3SuppliesCables fans & fittings ldt3-1-2012976508.3310,00jan-12
4SuppliesB&Q1-1-201211.2213,00jan-12
5Car, Travel, DeliveryEsso9-1-201216.6720,00jan-12
6FoodYosi's11-1-20128.408,40jan-12
7PayrollSecret Pantry8-1-2012100.00100,00jan-12
8FoodSainsburys4-1-20122.662,66jan-12
9FoodSainsburys12-1-20129.189,18jan-12
10
11100
Blad2


The UDF to use

Code:
Public Function SuperCountIf(ByVal Matrix As Range, _
                             ByVal AccountName As String, _
                             ByVal MonthPaid As Date) As Double

Dim sHeaderCriteria1 As String
Dim sHeaderCriteria2 As String
Dim sHeaderResult As String
sHeaderCriteria1 = "Account"
sHeaderCriteria2 = "Month Paid"
sHeaderResult = "Inc VAT"
Dim lHeader1 As Long
Dim lHeader2 As Long
Dim lHeaderR As Long
Dim Criteria1Value As String
Dim Criteria2Value As Date
Criteria1Value = AccountName
Criteria2Value = CDate(MonthPaid)
Dim vValues As Variant
Dim dblResults() As Double
Dim dblResult As Double
Dim lHeader As Long
Dim lValue As Long
Dim lCnt As Long
vValues = Matrix.Value
For lHeader = 1 To UBound(vValues, 2)
        
            If vValues(1, lHeader) = sHeaderCriteria1 Then lHeader1 = lHeader
            If vValues(1, lHeader) = sHeaderCriteria2 Then lHeader2 = lHeader
            If vValues(1, lHeader) = sHeaderResult Then lHeaderR = lHeader
Next lHeader
lCnt = 0
    For lValue = 1 To UBound(vValues, 1)
    
        If vValues(lValue, lHeader1) = Criteria1Value And vValues(lValue, lHeader2) = Criteria2Value Then
        ReDim Preserve dblResults(lCnt)
            dblResults(lCnt) = CDbl(vValues(lValue, lHeaderR))
            lCnt = lCnt + 1
        End If
    Next lValue
If lCnt > 0 Then
    For lCnt = 0 To UBound(dblResults)
        dblResult = dblResult + dblResults(lCnt)
    Next lCnt
End If
SuperCountIf = dblResult
End Function
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top