• 466K Members
• 9,718 Online
• 563K Conversations

New Contributor

# How to Index column header from defined data in table, Large to small

Hi,

I have a table that has multiple columns listing store names, and multiple rows listing Product names, and the sales data in the table for models sold by each store. I have created a formula successfully to list out the highest to lowest sales for a defined model, but I am having trouble indexing the store to which each listed Qty was sold by.

My formula to find High to low QTY:

={IFERROR(IF(MATCH(\$P\$1,\$A:\$A,0),LARGE(INDEX(\$A\$1:\$N\$15,MATCH(\$P\$1,\$A:\$A,0),\$B\$2:\$N\$15),ROW(1:1))),"")}

I have tried multiple formula's to list the corresponding store to the returned Qty Value (bearing in mind the sequence of stores returning the same value, and not just indexing the same store name for multiple same Qty's).

File is attached.

Any help is hugely appreciated.

5 Replies

# Re: How to Index column header from defined data in table, Large to small

assuming that you have latest version of office , you can check following formula

=INDEX(SORT(TRANSPOSE(FILTER(B1:N15,(A1:A15=P1)+(A1:A15="PRODUCT"))),2,-1),,1)

the formula is applied in attached file

# Re: How to Index column header from defined data in table, Large to small

unfortunately not 365. using 2016, which doesn't have Sort Function.

any alternative thought?

# Re: How to Index column header from defined data in table, Large to small

For such result

it could be

in S3

``=LARGE(INDEX(\$B\$2:\$N\$15,MATCH(\$P\$1,\$A\$2:\$A\$15,0),0),ROW()-ROW(\$S\$2))``

in T3

``````=INDEX(\$1:\$1,
AGGREGATE(15,6,
1/(INDEX(\$B\$2:\$N\$15,MATCH(\$P\$1,\$A\$2:\$A\$15,0),0)=\$S3)*COLUMN(\$B\$1:\$N\$1),
COUNTIFS(\$S\$3:\$S3,\$S3)
)
)``````

and drag them down

# Re: How to Index column header from defined data in table, Large to small

Thank you greatly, Sergei.

You are a Legend.

# Re: How to Index column header from defined data in table, Large to small

@dougs5220 , you are welcome

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies