• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Getting All Headers Name in Sorted based on Sorted Rows Values of Table

GrandZeno

New Member
Hi All Experts,

Today is my first day of registration and requirement, though i am learning from forum from past 6 months.
Right now i am working on a file which has Weekdays as Column Header, Current Price as a Row Header and PriceVariations as data.
so i need a formula to get when Current Price & weekdays based on sorted price.

I have attached my sample excel file with solution of Supportive Columns.
but i am looking for a formula output in single cell without supporting Columns.
may be my array function attempts in sample file could be modified to get desired output.

1704648684438.png
Please support and thanks in advance.
 

Attachments

  • TESTER.xlsx
    17.3 KB · Views: 7
Any cell in row 4:
Code:
=TEXTJOIN(" | ",FALSE,TAKE(SORT(VSTACK({" X ","Mon","Tue","Wed","Thu","Fri","Sat","Sun"},C4:J4),2,-1,TRUE),1))
or
Code:
=TEXTJOIN(" | ",FALSE,TAKE(SORT(VSTACK(SUBSTITUTE($L$3:$S$3,"Price"," X "),C4:J4),2,-1,TRUE),1))
or
Code:
=TEXTJOIN(" | ",FALSE,TAKE(SORT(VSTACK(SUBSTITUTE(LEFT($C$3:$J$3,3),"Cur"," X "),C4:J4),2,-1,TRUE),1))
copy down.

If you don't have VSTACK or TAKE then
Code:
=TEXTJOIN(" | ",FALSE,INDEX(SORT(CHOOSE({1;2},SUBSTITUTE(LEFT($C$3:$J$3,3),"Cur"," X "),C4:J4),2,-1,TRUE),1,0))

Or in a single cell in row 4:
Code:
=BYROW(C4:J24,LAMBDA(a,TEXTJOIN(" | ",FALSE,TAKE(SORT(VSTACK(SUBSTITUTE(LEFT(C3:J3,3),"Cur"," X "),a),2,-1,TRUE),1))))
which will spill down so no copy down needed.
 
Last edited:

GrandZeno

What kind of result do You looking for Product Code 007?
There are two duplicated values 13.80 & 12.30.
... then the result could be like Wed | Mon & Tue | X | Thu | Fri & Sun | Sat
 
Broadly speaking
Code:
= BYROW(priceVariation, LAMBDA(variation,
    TEXTJOIN(" | ",,SORTBY(day, variation,-1))
  ))
will return the result you require.
1705276312146.png
 

Attachments

  • TESTER.xlsx
    17.4 KB · Views: 5
Back
Top