简体   繁体   中英

Move the value of all cells in a column to their corresponding excel row number

Let's say i have the below list of Whole numbers in Column A. If you observe the list of numbers, you will see that number "5" and 6 is missing.

A
3
2
4
1
7
8

what I want to achieve is to place (sort) the numbers on the column such that each cell value will take its position according to excel row numbering. which means:

I should have something like this

1
2
3
4


7

If it's as simple as stated, this should work.

In column B, say:

=IF(COUNTIF(A:A,ROW())>0,ROW(),"")

在此处输入图像描述

Note: It does not account for duplicates, or anything complicated really.

Further Note: To clarify, all this does is check if the row that the formula is in, is in column A. If it is, then it returns the current row.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM