Search code examples
if-statementgoogle-sheetsarray-formulasgoogle-sheets-formulagoogle-sheets-query

How to divide each cell of a row with Maximum value of the same row


I have a Google sheet with multiple rows and columns. All having some floating point numbers.

I am trying to get the maximum value of all cells within each row and divide all cells in that row with the max value in that row. can we write a formula to achieve this? Any pointers on this are appreciated.


Solution

  • =ARRAYFORMULA(IF(A1:F9<>"", A1:F9/QUERY(TRANSPOSE(QUERY(TRANSPOSE(A1:F9),
     "select "&REGEXREPLACE(JOIN( ,ARRAYFORMULA(IF(LEN(A1:A9), 
     "max(Col"&ROW(A1:A9)-ROW(A1)+1&"),", ""))), ".\z", "")&"")),
     "select Col2"), ))
    

    0