Home > other >  Sum column wise the min values of each row in Google Sheets
Sum column wise the min values of each row in Google Sheets

Time:01-17

I would like to write the formula that sums for each column the values that are the minimum for each row.

I have a table like this:

A B C
1 10 20 5
2 3 4 9
3 1 7 4
Sum of only min 4 0 5

In the example, column A has 3 and 1 that are the minimum of row 2 and 3.

CodePudding user response:

You can try with this formula:

    =BYCOL(
MAP(A2:4,LAMBDA(e,IF(e=MIN(INDEX(A1:4,ROW(e))),e,IF(COUNTA(INDEX(A2:4,,COLUMN(e)))=0,"",0)))),
LAMBDA(each,IFERROR(SUM(each))))

enter image description here

CodePudding user response:

Here's another solution:

=ArrayFormula(BYCOL(IF(A1:C3=BYROW(A1:C3,LAMBDA(r,MIN(r))),A1:C3),LAMBDA(c,SUM(c))))
  • Related