简体   繁体   English

将一列所有单元格的值移动到对应的excel行号

[英]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 列中有以下整数列表。如果您观察数字列表,您会看到数字“5”和 6 丢失了。

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.我想要实现的是放置(排序)列上的数字,以便每个单元格值将根据 excel 行编号采用其 position。 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:在 B 列中,说:

=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.进一步注意:为了澄清,所有这一切都是检查公式所在的行是否在 A 列中。如果是,则返回当前行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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