Use a lookup to find 2nd and 3rd iteration

thewheatbread

New Member
Joined
Oct 6, 2022
Messages
6
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. MacOS
Greetings all! Trying to workout a situation that I'm stumped on where I need a lookup style function to return the name of the column when there are 2 or 3 digits within that column are the same.
I need the different LookupReason's to reference the corresponding Large value and then recall the corresponding column name if that makes sense; where it says CauseC under LookupReason2, it should really say CauseD and where it says CauseC under LookupReason3 it should really say CauseE. There is a simple LARGE function happening in the Large# columns.
Screen Shot 2022-10-06 at 10.57.14 AM.png

Thanks!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi & welcome to MrExcel.
Is this for Excel or for some other app like Google Sheets?
 
Upvote 0
Ok, how about
Excel Formula:
=TAKE(SORTBY($D$1:$H$1,D2:H2,-1),,3)
 
Upvote 0
Ok, you may not have the Take function yet.
How about
Excel Formula:
=INDEX(SORTBY($D$1:$H$1,D2:H2,-1),,{1,2,3})
 
Upvote 0
Ok, you may not have the Take function yet.
How about
Excel Formula:
=INDEX(SORTBY($D$1:$H$1,D2:H2,-1),,{1,2,3})
Yeah this one worked on my small example set but for some reason it is not working on my larger set. I'll play around with it and see what happens. It's a great jumping off point.
 
Upvote 0
Ok, any problems just post some sample data

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Ok, you may not have the Take function yet.
How about
Excel Formula:
=INDEX(SORTBY($D$1:$H$1,D2:H2,-1),,{1,2,3})
Ah ha! I have null values that have been set as a blank and it is pulling the null value titles instead. Any thought on how to deal with that?
 
Upvote 0
How about
Excel Formula:
=LET(f,FILTER(D2:I2,D2:I2<>""),INDEX(SORTBY(FILTER($D$1:$I$1,D2:I2<>""),f,-1),,{1,2,3}))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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