Priorities in Excel

samlim1014

New Member
Joined
Feb 1, 2019
Messages
1
Hi everyone,

I have a data set like the following.
Unfortunately, my data is a lot more complex than this so a simple Pivot won't let me analyse it :(

Name/YearApples?201620172018
JohnApplesApplesOranges
EmmaApplesApplesApples
DaveOrangesApplesOranges

<tbody>
</tbody>

How can I show in the first Column that John liked Apples in 2016 and 2017. I don't mind concatenations eg 2016Apples2017Apples; just can't seem to figure out how. :/

Hope this makes sense. Thank you.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Would something like this work for you?

This will return the years which have Apples.

=TEXTJOIN(", ", TRUE, IF(C2:E2="Apples", $C$1:$E$1, ""))

This is an array so enter with Ctrl, Shift and Enter.
 
Last edited:
Upvote 0
or PowerQuery with PivotTable

Name/Year201620172018Name/YearValueAttributeorName/YearJohn
JohnApplesApplesOrangesDaveApples2017
EmmaApplesApplesApplesOranges2016ValueAttribute
DaveOrangesApplesOranges2018Apples2016
EmmaApples20162017
2017Oranges2018
2018
JohnApples2016
2017
Oranges2018

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name/Year"}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"[/SIZE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,949
Members
448,534
Latest member
benefuexx

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