Hello Excel Geniuses, I'm looking for a UDF that can allow me to select a range of cells that have sequential values, and replace the all but the top and bottom values with a dash. If there is a blank cell somewhere, the space between would be replaced by a comma. Here's an example of what I'm looking for:
I have tables that look like this. The numbers will always be in order, but won't always be in every cell.
A |
B |
C |
D |
E |
F |
G |
1 |
2 |
|
5 |
6 |
7 |
|
5 |
|
|
6 |
7 |
8 |
|
3 |
|
|
|
14 |
|
|
So, let's say I've put the UDF in the last cell in every row. for example, the first one would look like this:
I'd want to be able to select the cells in each row and it would look something like this:
A |
B |
C |
D |
E |
F |
G |
1 |
2 |
|
5 |
6 |
7 |
2,5-7 |
5 |
|
6 |
7 |
8 |
10 |
5,6-8,10 |
|
3 |
|
14 |
|
|
3,14 |
Bookmarks