SUM of Data based on a Condition & Running Macro. PLEASE HELP!

jmcgillis14

New Member
Joined
Sep 24, 2014
Messages
12
I have a very long list that I run a macro for. I need the total credit cards (Visa + Master Card + American Express) for that day. On top of that I am running a Macro and the date range is different every time. I think I need a formula that consolidates the "Date" Column so it doesn't repeat then I can come up with a rules based on that to pull out the credit cards and add them up? Let me know if there is any way you can help. Thank you! Below is three columns which is an example of the data. To the right is an example of what I am trying to accomplish.

[TABLE="width: 712"]
<tbody>[TR]
[TD]Account Name[/TD]
[TD] Amount[/TD]
[TD] Date[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ACH[/TD]
[TD="align: right"]$24.03[/TD]
[TD="align: right"]8/17/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Cash[/TD]
[TD="align: right"]$21.00[/TD]
[TD="align: right"]8/17/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Checks[/TD]
[TD="align: right"]$71.61[/TD]
[TD="align: right"]8/17/2018[/TD]
[TD][/TD]
[TD] TRYING TO ACCOMPLISH BELOW:[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Credit Card - Visa[/TD]
[TD="align: right"]$156.00[/TD]
[TD="align: right"]8/17/2018[/TD]
[TD][/TD]
[TD]Total Credits Credit Cards[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Credit Card - Master Card[/TD]
[TD="align: right"]$25.00[/TD]
[TD="align: right"]8/17/2018[/TD]
[TD][/TD]
[TD="align: right"]$181.00[/TD]
[TD="align: right"]8/17/2018[/TD]
[/TR]
[TR]
[TD]Late Fee Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/17/2018[/TD]
[TD][/TD]
[TD="align: right"]$233.00[/TD]
[TD="align: right"]8/20/2018[/TD]
[/TR]
[TR]
[TD]Rental Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/17/2018[/TD]
[TD][/TD]
[TD="align: right"]$671.23[/TD]
[TD="align: right"]8/23/2018[/TD]
[/TR]
[TR]
[TD]Cash[/TD]
[TD="align: right"]$289.22[/TD]
[TD="align: right"]8/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Credit Card - American Express[/TD]
[TD="align: right"]$120.00[/TD]
[TD="align: right"]8/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Credit Card - Visa[/TD]
[TD="align: right"]$113.00[/TD]
[TD="align: right"]8/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Administrative Fee Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Late Fee Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Airport Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Parking Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Parking Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/21/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Rental Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/21/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Credit Card - Visa[/TD]
[TD="align: right"]$413.00[/TD]
[TD="align: right"]8/22/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Rental Revenue[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]8/22/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Credit Card - American Express[/TD]
[TD="align: right"]$260.00[/TD]
[TD="align: right"]8/23/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Credit Card - Master Card[/TD]
[TD="align: right"]$59.90[/TD]
[TD="align: right"]8/23/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Credit Card - Visa[/TD]
[TD="align: right"]$351.33[/TD]
[TD="align: right"]8/23/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Book1
ABCDEF
1Account NameAmountDate
2ACH$24.038/17/2018
3Cash$21.008/17/2018
4Checks$71.618/17/20184
5Credit Card - Visa$156.008/17/2018Total Credits Credit CardsDate
6Credit Card - Master Card$25.008/17/2018$181.008/17/2018
7Late Fee Revenue$0.008/17/2018$233.008/20/2018
8Rental Revenue$0.008/17/2018$413.008/22/2018
9Cash$289.228/20/2018$671.238/23/2018
10Credit Card - American Express$120.008/20/2018
11Credit Card - Visa$113.008/20/2018
12Administrative Fee Revenue$0.008/20/2018
13Late Fee Revenue$0.008/20/2018
14Airport Revenue$0.008/20/2018
15Parking Revenue$0.008/20/2018
16Parking Revenue$0.008/21/2018
17Rental Revenue$0.008/21/2018
18Credit Card - Visa$413.008/22/2018
19Rental Revenue$0.008/22/2018
20Credit Card - American Express$260.008/23/2018
21Credit Card - Master Card$59.908/23/2018
22Credit Card - Visa$351.338/23/2018
Sheet1


In F4 control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(ISNUMBER(SEARCH("credit card",$A$2:$A$22)),$C$2:$C$22),$C$2:$C$22),1))

In E6 just enter and copy down:

=IF($F6="","",SUMIFS($B$2:$B$22,$A$2:$A$22,"*credit card*",$C$2:$C$22,$F6))

In F6 control+shift+enter, not just enter, and copy down:

=IF(ROWS($1:1)>$F$4,"",MIN(IF(ISNUMBER(SEARCH("credit card",$A$2:$A$22)),IF(ISNA(MATCH($C$2:$C$22,$F$5:F5,0)),$C$2:$C$22))))
 
Upvote 0

Forum statistics

Threads
1,223,704
Messages
6,173,984
Members
452,540
Latest member
haasro02

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