Returning Values Based on Referent Cells (Avoiding Redundant Values)

merlinCLT

New Member
Joined
Mar 3, 2020
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi Mr. Excel Gurus,

I am attempting to create a column (K) which reflects the top three motives/values from scores on a personality inventory. Essentially, the logic is to look across the values of each record (i.e., participant) in each motive category (columns A:J) and return the top three motives (e.g., Altruistic, Power, Science) based on the corresponding numerical values recorded for each record. I have gotten far enough along to where I am pulling values using a combination of TEXTJOIN, INDEX, MATCH, and LARGE:
=TEXTJOIN(", ", TRUE,
INDEX($A$1:$J$1, MATCH(LARGE(A2:J2, 1), A2:J2, 0)),
INDEX($A$1:$J$1, MATCH(LARGE(A2:J2, 2), A2:J2, 0)),
INDEX($A$1:$J$1, MATCH(LARGE(A2:J2, 3), A2:J2, 0))
)

This formula returns the top motives where the one with the largest numerical value is listed first.

THE ISSUE: I am running into an issue (see row 4 in the attached Excel document) where Excel is returning a redundant motive because two motives have the same value (see cell K4 in the attached Excel document). I have consulted with ChatGPT to try to reconcile this issue using different formulas and conditions and VBA. I have not been able to successfully mitigate the issue and would value the help from the Mr. Excel community.

Desired OUTCOME: I want the formula to refer to a redundant value only once so that the appropriate motive can be listed in column K. That is, in the attached document, I want cell K4 to return "Altruistic, Tradition, Science" rather than its present value of "Altruistic, Altruistic, Science."

Thanks, in advance, for your support! Also, these data have been randomly generated, so there is no sensitive data here.

1708003876588.png


-MerlinCLT
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
What should happen on row 10 where you have 3 equal values for the 3rd place?
 
Upvote 0
What should happen on row 10 where you have 3 equal values for the 3rd place?
Good question! It would be fine to have any of the three represented, so maybe the first occurrence (i.e., Hedonism).
 
Upvote 0
Ok, how about
Excel Formula:
=TEXTJOIN(", ",,TAKE(SORTBY($A$1:$J$1,A2:J2,-1),,3))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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