SumIfs VBA formula

kerstinedatu

New Member
Joined
Jul 25, 2018
Messages
1
Hi All,

I am currently trying to write a code with SUMIFS formula but I'm having difficulty as I'm still a newbie at VBA.
I tried using other codes from different forums including here but to no avail.
Would also like to know if the code can loop for all blank cells in case other criteria will be added in the future.

Below is a sample of what I'm currently working on.

[TABLE="width: 506"]
<colgroup><col><col><col><col span="3"></colgroup><tbody>[TR]
[TD="colspan: 6"][TABLE="width: 506"]
<colgroup><col><col><col><col span="3"></colgroup><tbody>[TR]
[TD="colspan: 6"]Sheet 1 (Received)[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD] [/TD]
[TD]Total[/TD]
[TD] 1,312.00[/TD]
[TD] 57,206.00[/TD]
[TD] 57,206.00[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD] [/TD]
[TD]Bank[/TD]
[TD]1/1/2018[/TD]
[TD]1/2/2018[/TD]
[TD]1/3/2018[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD]JMC[/TD]
[TD]JP Morgan Chase[/TD]
[TD] 1,000.00[/TD]
[TD] 1,000.00[/TD]
[TD] 1,000.00[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD]BOA[/TD]
[TD]Bank of America[/TD]
[TD] - [/TD]
[TD] 1,000.00[/TD]
[TD] 1,000.00[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD]CG[/TD]
[TD]Citigroup[/TD]
[TD] - [/TD]
[TD] - [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD]WF[/TD]
[TD]Wells Fargo[/TD]
[TD] - [/TD]
[TD] - [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD]GS[/TD]
[TD]Goldman Sachs[/TD]
[TD] 312.00[/TD]
[TD] 312.00[/TD]
[TD] 312.00[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD]MS[/TD]
[TD]Morgan Stanley[/TD]
[TD] - [/TD]
[TD] 54,894.00[/TD]
[TD] 54,894.00[/TD]
[/TR]
[TR]
[TD="align: right"]17[/TD]
[TD]USB[/TD]
[TD]U.S Bancorp[/TD]
[TD] - [/TD]
[TD] - [/TD]
[TD] - [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD="align: right"][TABLE="width: 462"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD="colspan: 5"]Sheet 2 (Details)[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]Branch[/TD]
[TD]Bank Account[/TD]
[TD]Cheque Amount[/TD]
[TD]Date Received from EO[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD="align: right"]1[/TD]
[TD]JP Morgan Chase[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]1/1/2018[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]1[/TD]
[TD]Bank of America[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]1/2/2018[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD="align: right"]2[/TD]
[TD]Citigroup[/TD]
[TD="align: right"]5000[/TD]
[TD="align: right"]1/4/2018[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]3[/TD]
[TD]Wells Fargo[/TD]
[TD="align: right"]82116[/TD]
[TD="align: right"]1/7/2018[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]1[/TD]
[TD]Goldman Sachs[/TD]
[TD="align: right"]312[/TD]
[TD="align: right"]1/1/2018[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD="align: right"]2[/TD]
[TD]Morgan Stanley[/TD]
[TD="align: right"]54894[/TD]
[TD="align: right"]1/2/2018[/TD]
[/TR]
[TR]
[TD="align: right"]17[/TD]
[TD="align: right"]1[/TD]
[TD]U.S Bancorp[/TD]
[TD="align: right"]16549[/TD]
[TD="align: right"]1/4/2018[/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]

[/TD]
[/TR]
</tbody>[/TABLE]
Formula from D11 to infinity is =SUMIFS(Details!$D:$D,Details!$C:$C,Received!$C11,Details!$E:$E,Received!D$10)

Formula for D9:_9 is =SUM(D11:D66)

Hope someone can help me.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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