79425851

Date: 2025-02-09 23:38:04
Score: 5
Natty: 4
Report link

@Ron Rosenfeld Thanks so much! I've been using Excel for about as long as it's been around, but am only just getting my head around LET. This was an excellent solution and very well explained! So well explained, that I was able to adapt to my case, where I also needed to use CHOOSECOLS. Here, the table is D_KPI_T2. The initial filter is based on a column selected by the value of a dropdown in $D$4, where that column contain "=" (which is formatted in Wingdings to appear as a bullet). I then choose the columns, before sorting them. I had FILTER and CHOOSECOLS working without LET, but it fell apart when I tried to add SORTBY. I hadn't made the connection that I needed to use INDEX to solve the 'conceptual problem' you pointed out. Nor had I appreciated that LET would make this so much easier to understand.

=LET(
x,FILTER(D_KPI_T2,INDEX(D_KPI_T2,0,MATCH($D$4,D_KPI_T2[#Headers],0))="="),
y,CHOOSECOLS(x,1,2,4),
z,SORTBY(y,INDEX(y,0,1),1,INDEX(y,0,2),1,INDEX(y,0,1),1),
z)

Cheers!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): Cheers
  • Blacklisted phrase (1): appreciated
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Ron
  • Looks like a comment (1):
  • Low reputation (1):
Posted by: AlistairLW