Lookup for top value in each column and output row name

raikks

Board Regular
Joined
Feb 23, 2020
Messages
53
Office Version
  1. 2019
Platform
  1. Windows
colAcolB
row1
3​
7​
row2
5​
4​
row3
12​
7​

Lookup for the top value in each column. then output the row's name.

Ex.
* for colA -> output row3
* for colB -> output row1 & row3 (if possible)
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Please try

Book1
AB
137
254
3127
4
5Row3Row1, Row3
Sheet1
Cell Formulas
RangeFormula
A5:B5A5=TEXTJOIN(", ",,INDEX(REPT("Row"&ROW(A1:A3),A1:A3=MAX(A1:A3)),))
 
Upvote 0
Thanks for your reply.
This partially solves my problem.
Maybe my example wasn't very clear because the row names are important - let me rename them:
* row1 - apples
* row2 - bananas
* row3 - oranges

I don't mind using an additional function to replace text.
 
Upvote 0
Try this

20 10 11.xlsm
ABC
1apples37
2bananas54
3oranges127
4
5orangesapples, oranges
Textjoin
Cell Formulas
RangeFormula
B5:C5B5=TEXTJOIN(", ",1,IF(B1:B3=MAX(B1:B3),$A1:$A3,""))
 
Upvote 0
Unfortunately, it doesn't work - copy pasted exactly the same example as above and the result is #VALUE!
I'm not sure why...
 
Upvote 0
You need to confirm Peter_SSs's formula with Ctrl+Shift+Enter

or this with normal enter
Book1
ABC
1apples37
2bananas54
3oranges127
4
5orangesapples, oranges
Sheet1
Cell Formulas
RangeFormula
B5:C5B5=TEXTJOIN(", ",,INDEX(REPT($A1:$A3,B1:B3=MAX(B1:B3)),))
 
Upvote 0
Unfortunately, it doesn't work - copy pasted exactly the same example as above and the result is #VALUE!
I'm not sure why...
Since you don't have Office 365, you have to enter the formula as an array formula, holding CTRL+SHIFT and pressing ENTER. The formula in the formula bar will then look like this:
{=TEXTJOIN(", ",1,IF(B1:B3=MAX(B1:B3),$A1:$A3,""))}
 
Upvote 0
Since you don't have Office 365, you have to enter the formula as an array formula, holding CTRL+SHIFT and pressing ENTER. The formula in the formula bar will then look like this:
{=TEXTJOIN(", ",1,IF(B1:B3=MAX(B1:B3),$A1:$A3,""))}
Thanks, works fine now.
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top