arraysif-statementgoogle-sheetsgoogle-sheets-formulags-vlookup

Is there a better way to group rows together with names from another column


Is there a faster way to do create the same results here. I am trying to group rows together based on the value in column K with a group name in column O. I want to add the Group Name in column O to a new column

=IFS((K1=$P$2), $O$2,(K2=$P$3),  $O$3,(K3=$P$4), $O$4, "")

The formula is doing what I want it to do, but it would go all the way to K150 so I am wondering if there is a faster more efficient way to do this.


Solution

  • try:

    =ARRAYFORMULA(IFNA(VLOOKUP(K1:K150, {P2:P, O2:O}, 2, 0)))