Numbering a multi-heading Excel column

tdungdinh

New Member
Joined
Oct 20, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have an Excel sheet that needs a numbered heading (column H in the photo). How can I use only functions rather than VBA in this case?
 

Attachments

  • Numbering.PNG
    Numbering.PNG
    17.4 KB · Views: 9

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Welcome to the MrExcel forum!

Try:

Book1
HIJ
1OrderCountryScore
2IRUSSIA38
3aClass 108
41Puskin Ramsey8
5bClass 117
61Lenina7
7cClass 1223
81Paroski Andrei8
92Lewandos Expki8
103Alexander Wang7
11IIVIETNAM34
12aClass 1010
131Hoang Van An10
14bClass 1117
151Nguyen Van Binh9
162Tran Tuan Anh8
17cClass 127
181Le Tuan Anh7
Sheet8
Cell Formulas
RangeFormula
H2:H18H2=IF(ABS(CODE(RIGHT(I2))-77.5)<13,ROMAN(SUMPRODUCT(--(ABS(CODE(RIGHT(I$1:I1))-77.5)<13))+1),IF(LEFT(I2,5)="class",CHAR(COUNTIF(INDEX(I:I,AGGREGATE(14,6,ROW(I$2:I2)/(ABS(CODE(RIGHT(I$2:I2))-77.5)<13),1)):I2,"class*")+96),N(H1)+1))


Countries are identified by the last letter being capitalized, and the classes by the word class on the left.
 
Upvote 0
Countries are identified by the last letter being capitalized, and the classes by the word class on the left.
Really thanks so big for your useful answer. However, my further purpose is giving a multi-heading number for any 3 or 4-level pivot table (as my regular reports). So the above quotation is only applied for this case (with level 1 country, level 2 class). Is there any possible solution for every 3 or 4-level pivot table of which headings have no similar details?

p/s: I have no knowledge about VBA, so function is preferred.
 
Upvote 0
Sorry, I don't know of any way to create 3/4-level headings for a pivot table, especially when I don't have any specific way to identify what level each heading might be. There might be some way in the pivot table settings directly, but I don't know enough about them to say for sure.
 
Upvote 0

Forum statistics

Threads
1,215,216
Messages
6,123,669
Members
449,114
Latest member
aides

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