![](/img/trans.png)
[英]How can I find the closest matching value ABOVE the current cell, and return a different column in that same row?
[英]How to count column 1 and return result in column 2 for specific ID numbers for current row and above?
我試圖弄清楚如何計算 ID 在當前行及以上行的 ID # 列中的每個實例。 然后在計數列中顯示計數。
例如:
ID # | 數數 |
---|---|
15404 | 1 |
15404 | 2 |
15404 | 3 |
99999 | 1 |
55512 | 1 |
99999 | 2 |
34489 | 1 |
15404 | 4 |
嘗試:
=QUERY(A:B; "select A,count(B) where A is not null group by A label count(B)''")
或另一個選項,放置在第 2 行的任何位置:
=ArrayFormula(COUNTIFS(A2:A,A2:A,ROW(A$2:A),"<="&ROW(A2:A)))
它可以以這種格式放置在第 1 行的任何位置:
={"Header label text"; ArrayFormula(countifs(A2:A,A2:A,ROW(A$2:A),"<="&ROW(A2:A)))}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.