Hi I would like to write a function to return a string as follows. Can someone help me? Thank you.
1
2
3
4
5
9
10
1-5, 9-10 <== all in one cell
Hi I would like to write a function to return a string as follows. Can someone help me? Thank you.
1
2
3
4
5
9
10
1-5, 9-10 <== all in one cell
Sorry, but we might need a bit more information:
1. Is this function going to be code in VBA, or does it have to be a formula?
2. Is there an upper limit to the number of elements you'll want to combine in one cell?
3. Will the data always be in ascending order?
4. Are the maximum and minimum values for the numbers in the array (e.g. will they always be in the range 1-10?)
5. Will there be duplicate values in the data?
6. Will the data always be integer values?
To pre-empt the answer to the first question, this is almost certainly a nightmare to do as a formula, so you're probably looking at some VBA code.
Thank you for replying my questions. and Sorry for not being specific. Here is my thoughts
1. Is this function going to be code in VBA, or does it have to be a formula?
Yes, it is going to be code in VBA as a function to deal with this kind of array with a column of numbers.
2. Is there an upper limit to the number of elements you'll want to combine in one cell?
No. all numbers are located in one column and the upper limit is like over 1000. If there is a limit for a string in a cell, the upper limit should be defined. I would like to build a function that has array range as input like A2:A200. The number might not be the sequence of numbers but they are in order like 1, 2, 4, 5, 6, 13, 14, 15, 25, 27, 30.....
3. Will the data always be in ascending order?
Yes, it will.
4. Are the maximum and minimum values for the numbers in the array (e.g. will they always be in the range 1-10?)
Maximum is something like 7000. Minimum varies and it depends on the first number in the array.
5. Will there be duplicate values in the data?
No, there is no duplicate values.
6. Will the data always be integer values?
Yes, only integer values.
If you have any other concerns, please feel free to ask. It would be appreciated.
Gary
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks