excel 显示一个标签,根据第二列中的数据从第一列中抽出,在第三列中排序-即排名

km0tfn4u  于 2022-12-14  发布在  其他
关注(0)|答案(2)|浏览(120)

Imagine you have spreadsheet with data in a fixed # of contiguous rows.. let's say row 1 through row 20
Now let's say you have 3 columns of interest.
A, B and C
Column A is a label column.. the data in there are just string labels.. let's say types of canned food.. Tuna, Spam, Sardines, etc.
Column B is our number column.. let's say it is prices. e.g. 2 for Tuna, 5 for Spam and 3 for Sardines. These prices can change often very rapidly.. ok so prices are not the best example but let's imagine that prices change rapidly.
Now Column C is where we want to put the formula.
I would like to have a formula in Column C that will pull the labels from Column A, based on their prices in column B and rank them from highest to lowest.. that is C1 would calculate to "Spam", C2 to "Sardines" and C3 to "Tuna"
right now there are 20 rows of data.. but maybe at some other point there might be 30 or 6 or 40, etc.
So can someone help me out with the formula or at least explain what functions I need to use and the general idea involved? thanks

llycmphe

llycmphe1#

=IF(A2:A200〈〉"";排序(A2:A200; B2:B200;-1);“”)

ozxc1zmp

ozxc1zmp2#

您可以简单地使用SORT公式。在本例中,=SORT(A1:B1000,2,-1),其中A1:B1000是要排序的范围,第二个参数2是要排序的范围中的列号,第三个参数表示顺序(-1是降序)。将公式放在C1中,您将得到溢出的数组。

相关问题