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
2条答案
按热度按时间llycmphe1#
=IF(A2:A200〈〉"";排序(A2:A200; B2:B200;-1);“”)
ozxc1zmp2#
您可以简单地使用
SORT
公式。在本例中,=SORT(A1:B1000,2,-1)
,其中A1:B1000
是要排序的范围,第二个参数2
是要排序的范围中的列号,第三个参数表示顺序(-1
是降序)。将公式放在C1中,您将得到溢出的数组。