Lookup a list of values and return values in singe cell concatenated format

rstuart76

New Member
Joined
May 21, 2017
Messages
1
Hi - looking for a formula/code to lookup a range of values from a matched value and present them in a single cell concatenated format including range and comma separator:

There will sometimes be sequential values that can be ranged i.e. 100-106 but then there may be single values so needs to display i.e. 100-106, 110

DATA


R/CAB
2NameCode
3Robby2234
4Robby2235
5Robby2236
6Robby3455
7Dave9867
8Dave9868
9Dave3232
10Dave1112

<tbody>
</tbody><colgroup><col span="2"><col></colgroup>
OUTPUT TO:

NameCode Range
Robby2234-2236,3455
Dave9867-9868,3232,1112

<tbody>
</tbody><colgroup><col span="2"></colgroup>
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,216,057
Messages
6,128,523
Members
449,456
Latest member
SammMcCandless

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