我有成千上萬的資料單元格,其標題格式為
UID、日期、質量、開始/結束、浮動天數、從開始的天數
我有一個簡單版本的作業表如下所示:
每個新資料條目都作為一行輸入。每個 UID(唯一 ID)的資料是在其浮動生命周期內的不一致天數中獲取的。(例如:木頭漂浮,我在不同的日子取它的質量,直到它下沉)。
我想通過獲取接收日期并通過 ID 的第一個參考減去它來識別“浮動天數”。
#simple:
When the row has "1" in the D column, Find the ID on that row, then find that ID when that row has "0".
Take the date from that row and subtract by sink date to give me float days
#complex:
=IF(D16="1", (vlookup(A16 & "0",$A$1:$F$999,2,0)-B16, "")
如果可能的話,我想使用公式的框架來計算每個資料輸入的日期,從它的開始日期開始,如下所示:
#simple: in row E
Take the date from current row (row 10 for example), find that ID's start date,
subtract from one another to give me days from time=0
#complex:
=B10-vlookup(A10 & "0",$A$1:$F$999,B,0)
我很困惑我是否輸入了錯誤的公式,或者是否有另一種更簡單的方法來做到這一點。謝謝!
uj5u.com熱心網友回復:
SUMFIS 是這里更好的選擇。在單元格 E2 中并向下復制:
=IF(D2=1,B2-SUMIFS(B:B,A:A,A2,D:D,0),"")
如果您希望同一天的開始/結束對等于 1 而不是 0,只需在 SUMIFS 的末尾添加 1。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/496824.html