我有以下困境。
我需要在rank中对数据进行排序,就像我在SQL中对数据进行排序一样,如下所示:
declare @table table
(id int identity primary key , batchid int)
insert into @table (batchid) select 10
insert into @table (batchid) select 35
insert into @table (batchid) select 35
insert into @table (batchid) select 35
insert into @table (batchid) select 8
insert into @table (batchid) select 21
insert into @table (batchid) select 10
insert into @table (batchid) select 11
insert into @table (batchid) select 4
insert into @table (batchid) select 10
insert into @table (batchid) select 11
insert into @table (batchid) select 4
insert into @table (batchid) select 21
insert into @table (batchid) select 8
insert into @table (batchid) select 21
insert into @table (batchid) select 8
insert into @table (batchid) select 21
insert into @table (batchid) select 4
insert into @table (batchid) select 21
insert into @table (batchid) select 10
insert into @table (batchid) select 21
insert into @table (batchid) select 11
insert into @table (batchid) select 21
insert into @table (batchid) select 8
insert into @table (batchid) select 21
insert into @table (batchid) select 10
insert into @table (batchid) select 21
insert into @table (batchid) select 10
insert into @table (batchid) select 21
select
batchid
, rank() over (partition by batchid order by id) [RANK]
from @table我看了很多YouTube视频和关于如何在Excel中使用rank的教程,但是我没有看到在上面的代码中可以看到rank的partition by选项。
参见下面的上述脚本的结果:

在Excel中可以使用什么公式来实现相同的结果?
发布于 2018-12-07 10:11:44
简单的公式很容易实现:

在单元格B1中,输入初始值1。然后,在B2中输入一个公式:
=IF(A1=A2,B1+1,1)那就一直拖下去。
https://stackoverflow.com/questions/53667289
复制相似问题