英文:
Assign zero to diagonal cells without changing the matrix in Excel
问题
我想要实现LARGE()
函数,不改变矩阵的情况下将对角元素置为零,可以通过以下方式实现:=IF(ROW()=COLUMN(),0,"")
,如果允许改变基础矩阵的话。
英文:
I want to implement LARGE()
function without changing the matrix while assigning zero to diagonal elements which can be achieved through =IF(ROW()=COLUMN(),0,"")
if the change of base matrix is allowed.
答案1
得分: 2
=使用MAP函数从您的数组创建一个新数组。在LAMBDA公式中使用您的IF逻辑。这将创建一个所有对角线都是零的数组:
=MAP(A1:F6, LAMBDA(a, IF(ROW(a) = COLUMN(a), 0, a)))
将其放在您的LARGE公式中,这样将从新数组中获取第10大的值:
=LARGE(MAP(A8:F13, LAMBDA(a, IF(ROW(a) = COLUMN(a), 0, a))), 10)
英文:
Use the MAP function to create a new array from your array. Use your IF logic in the LAMBDA formula. This creates an array where all the diagonals are zeros:
=MAP(A1:F6,LAMBDA(a,IF(ROW(a)=COLUMN(a),0,a)))
Put that inside your LARGE formula, so this would take the 10th largest value from the new array:
=LARGE(MAP(A8:F13,LAMBDA(a,IF(ROW(a)=COLUMN(a),0,a))),10)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论