How to automatically group changing data ?

Ekmelnikov

New Member
Joined
Nov 30, 2022
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
I work as a sales data analyst for a clothing manufacturer. And I often make sales reports that are structured by Brand-season-Category.

I constantly have to manually select rows and group data. Maybe there is a way to write a macro to do this automatically ?

A macro with constant strings will not work, since the number of categories for different brands may change from report to report, since the nomenclature and the review period change periodically.

I attach a picture of an example of how the data looks and how they should be grouped:


Книга12
ABC
2BRAND 1SALES 46 WEEKSALES 47 week
3AW18-1922
4 Trousers
5 Turtleneck
6 Leggings
7 Longsleeve
8 Pajamas (longsleeve, trousers)
9 Dress
10 Sliders
11 Sweatshirt
12 Sweatshirt (with collar)
13 Sweatshirt (with zipper)
14 T-shirt
15 Hoodies
16AW19-20
17Bomber11
18Trousers
19Turtleneck
20Cardigan
21Leggings
22Longsleeve
23Nightgown
24Dress
25Sweatshirt1
26Slip
27Top
28Tunic
29T-shirt
30Polo Shirt1
31Shorts
32BRAND 2311341
33SS22311341
34Suit (sweatshirt, trousers)10
35Suit (T-shirt, shorts)04
36Suit (hoodie, trousers)3316
37Pajamas (jacket, trousers)2136
38Bedspread (waffle)02
39Towel (waffle)17
40Towel (with hood)111
41Bathrobe (with hood)254265
Лист1
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I constantly have to manually select rows and group data. Maybe there is a way to write a macro to do this automatically ?

In this sample:
Which rows and data group need to be selected?
Do you mean:
- manually select = hightlight by mouse dragging
or
- built a dynamic SUM with dynamic range
?
 
Upvote 0
Now I select everything that is not in bold with the mouse and group it manually

But I want to know if it is possible to write some kind of macro for automatic grouping. ( ( Again, I can't set constant cells in the macro, since the number of categories and brands can change from week to week )
In this sample:
Which rows and data group need to be selected?
Do you mean:
- manually select = hightlight by mouse dragging
or
- built a dynamic SUM with dynamic range
?
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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