Sep 22 2024 07:49 PM
I have this formula for excel that gives me the most common value in a range.
The problem I have is that if a cell in the range is blank it becomes NA. This is the formula =@INDEX(K5:AF5,MODE(MATCH(K5:AF5,K5:AF5,0)))
What I need is for the formula to work even if there is a cell with no value in it. And it possible it would be preferable if it only considered the text not number fields but I expect I would need to select each cell rather than have a range?
Sep 22 2024 08:38 PM - edited Sep 22 2024 08:39 PM
@AHegan Use a TOROW() function before lookup_value.
=@INDEX(K5:AF5,MODE(MATCH(TOROW(K5:AF5,1),K5:AF5,0)))
Alternatively you can use XLOOKUP() like.
=LET(x,K5:AF5,y,COUNTIFS(x,x),XLOOKUP(MAX(y),y,x))
Sep 22 2024 09:02 PM