Table of contents
1 How to display serial number in EXCEL?
3 How to get the sequence number after sorting?
3.1 The serial numbers of rank() may be discontinuous
3.2 Method 2: SUMPRODUCT((C7>C$7:C$12)/COUNTIF(C$7:C$12,C$7:C$12))+1
How to display serial number in EXCEL? How to reorder? How to get the sequence number after sorting?
These are 3 problems, to be solved separately
Only for numeric columns!
1 How to display serial number in EXCEL?
- If you just want to display the serial number
- There is no need to add auxiliary columns, just use ROW(C32)-ROW(C$32)+1 directly to generate natural serial numbers and row serial numbers
2 How to reorder?
- Size sorting can be achieved with small() large()
- The serial number is generated by the above method
3 How to get the sequence number after sorting?
3.1 The serial numbers of rank() may be discontinuous
- You can see that the discontinuous serial numbers like 1,3,5 are very strange
3.2 Method 2: SUMPRODUCT((C7>C$7:C$12)/COUNTIF(C$7:C$12,C$7:C$12))+1
Principle: Determine whether it is greater than the previous number + add up the repeated numbers/number
ascending order,
=SUMPRODUCT((C7>C$7:C$12)/COUNTIF(C$7:C$12,C$7:C$12))+1
descending order
=SUMPRODUCT((C$7:C$12>C7)/COUNTIF(C$7:C$12,C$7:C$12))+1