У меня следующая дилемма.
Мне нужно rank
данные в Excel, так же, как я ранжирую их в 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 видео и учебных пособий о том, как rank
в Excel , однако я не вижу опции partition by
, что rank
, как это видно в кодевыше.
См. ниже результаты приведенного выше сценария:

Какую формулу можно использовать в Excel для достижения тех же результатов?