Lookup value with same criteria

ryan0521

Board Regular
Joined
Dec 7, 2016
Messages
79
Happy new year!

Can anyone help me with this one.

I want to separate values base on their criteria, please see below for the data.
Look up valueCriteria
100Apple
101Apple
102Apple
103Apple
200Ball
201Ball
202Ball
203Ball
204Ball
300Cat
301Cat
302Cat

<tbody>
</tbody>


And I want to have a result like this

AppleBallCat
1100200300
2101201301
3102202302
4103203
5204

<tbody>
</tbody>


Thanks in advance
 
Last edited:

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
Look up valueCriteria453
100Appleappleballcat
101Apple100200300
102Apple101201301
103Apple102202302
200Ball103203
201Ball204
202Ball
203Ball
204Ball
300Cat
301Cat
302Cat

<tbody>
</tbody>


In D1 enter and copy across:

=COUNTIFS($B$2:$B$13,D$2)

In D3 control+shift+enter, not just enter, copy across, and down:

=IF(ROWS(D$3:D3)>D$1,"",INDEX($A$2:$A$13,SMALL(IF($B$2:$B$13=D$2,ROW($A$2:$A$13)-ROW($A$2)+1),ROWS(D$3:D3))))
 

Watch MrExcel Video

Forum statistics

Threads
1,123,514
Messages
5,602,089
Members
414,501
Latest member
mdhaumyu

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
Top