How to sort subgroups and sum?

fowloutforever

New Member
Joined
Feb 8, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
New to VBA so please excuse my ignorance. I have a daily bank transactions spreadsheet that needs to be sorted in a specific way.

First, the debits need to be at the top, followed by the credits. If the transaction is a debit, it will have a value in column E, otherwise it will be blank. Same for credits, except the value in is column F.

Next, the data needs to be sorted by column B so that any existing groups are together. Ex. Checks, Deposits, etc.

This next part is where I’m struggling. There are some transactions that need to be grouped together, but they don’t have the exact same name. For instance, Wires and Transferxxx need to be together but are not when alphabetically sorted. Also, because this is based on daily account history, it changes so the data only needs to be sorted like this when there is more than one of that subgroup.

How can I accomplish this and then also sum these subgroups together?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
How I would approach this problem:
1) Gather all unique transaction types on another sheet. You can easily achieve by copying that column and paste into another sheet, then use Excel's Data->Remove Duplicates function.
2) Assign a code or number to group transactions like you needed. Example: Checks = 1, Deposits = 2, and both "Wires" and "Transferxxx" can have a number of 3.
3) Create a new (helper) column on the main sheet, use Vlookup or Index/Match to get the assigned numbers to every row.
4) Sort data on 3 levels: 1. By new helper column, 2. By Debits, 3. By Credits
5) Do a SUMIF based on those codes
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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