Hi, I've been working on consolidating some data and was wondering what is the best approach using VBA Dictionaries or arrays to go from this range:
To this range which contains a unique list of values based on Columns A:C(Date, Name, Location), and the fourth columns gives you the total amount for each combination(A sumifs in essence).
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Date | Name | Location | Bonus | Amount | ||
2 | 10/12/2023 | John Doe | New York | 0 | 381 | ||
3 | 10/12/2023 | Jane Doe | New York | 0 | 126 | ||
4 | 10/12/2023 | Jack Doe | New York | 0 | 272 | ||
5 | 10/12/2023 | John Doe | New York | 0 | 522 | ||
6 | 10/12/2023 | Jane Doe | New York | 0 | 745 | ||
7 | 10/13/2023 | John Doe | New York | 0 | 144 | ||
8 | 10/13/2023 | Jane Doe | New York | 0 | 754 | ||
9 | 10/13/2023 | Jack Doe | New York | 0 | 263 | ||
10 | 10/13/2023 | John Doe | New York | 0 | 103 | ||
11 | 10/13/2023 | Jane Doe | New York | 0 | 525 | ||
12 | |||||||
13 | |||||||
Sheet1 |
To this range which contains a unique list of values based on Columns A:C(Date, Name, Location), and the fourth columns gives you the total amount for each combination(A sumifs in essence).
Book1 | ||||||
---|---|---|---|---|---|---|
J | K | L | M | |||
1 | Date | Name | Location | Amount | ||
2 | 10/12/2023 | John Doe | New York | 903 | ||
3 | 10/12/2023 | Jane Doe | New York | 871 | ||
4 | 10/12/2023 | Jack Doe | New York | 272 | ||
5 | 10/13/2023 | John Doe | New York | 247 | ||
6 | 10/13/2023 | Jane Doe | New York | 1279 | ||
7 | 10/13/2023 | Jack Doe | New York | 263 | ||
8 | ||||||
9 | ||||||
Sheet1 |