我想從excel中獲取值的最大值n值,n是可變的。下面是一個例子與ň = 5: Explanation: it starts at A6 when it have 5 values and enough data to compute the max of the 5 previous values, so it looks backwardsn值的最大值,excel
說明:它開始於A6,當它有5個值和足夠的數據來計算5個先前值的最大值,所以看起來倒退。
與Ñ = 10又如:
The range is always looking backwards the number of values that the constant is, so if constant =10 then it looks the 10 previous values. 我需要的是在B列改變的範圍內尋找最大如果恆定值變化的公式或陣列式。
有任何問題,問我。 謝謝。
使用提供的第一個例子,其中Constant = 5,單元格B7將返回10的錯誤結果,因爲B7將評估範圍爲A7:A11而不是A3的正確範圍:A7 – tigeravatar
您可以通過使用' - $ C $ 2'在第二個偏移量函數中 – tigeravatar
實際上,您可以將公式大大簡化爲僅僅是'= IF(ROW()<= $ C $ 2,「」,MAX(OFFSET(A2,0,0, - $ C $ 2,1)))' – tigeravatar