bobby_smith
Board Regular
- Joined
- Apr 16, 2014
- Messages
- 90
I would like some assistance creating two separate “user defined functions” whereby when I select the data, it separates the data to either number or text.
I’ve included the format that the data will normally be in.
Also please note that i'm requesting a function and not a macro so that for example I can type in cell
B2: =function1(A2) and get the results that are shown in cell B2
Excel 2010
<tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]5678[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]76[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]254[/TD]
</tbody>
I currently use the text features such as LEFT(), MID(), RIGHT(), but my results are inconsistent because both the numbers and text may vary in length.
I’ve also tried the “Text to Column” feature, however the result is inconsistent because the text at the end varies in length. For example, if I have 200 lines of items of different length, the text to column feature would sometimes put data in adjacent cells overwriting information already in those cells
What I need the function to do is, upon selecting the data
1) Only the numbers remain
2) Only the text after the numbers remain.
Hence Why I would prefer two separate macros.
I would really appreciate your help with this.
I’ve included the format that the data will normally be in.
Also please note that i'm requesting a function and not a macro so that for example I can type in cell
B2: =function1(A2) and get the results that are shown in cell B2
Excel 2010
A | B | C | |
---|---|---|---|
Original Data | Function 1 | Function 2 | |
TD 5678 TEXT TEXT | TEXT TEXT | ||
TI 76 TEXT TEXT TEXT TEXT | TEXT TEXT TEXT TEXT | ||
NT 254 TEXT TEXT TEXT | TEXT TEXT TEXT |
<tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]5678[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]76[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]254[/TD]
</tbody>
Sheet3
It will always be two letters,followed by numbers that can range from 1 digit to four digits, and then text that can be any length.I currently use the text features such as LEFT(), MID(), RIGHT(), but my results are inconsistent because both the numbers and text may vary in length.
I’ve also tried the “Text to Column” feature, however the result is inconsistent because the text at the end varies in length. For example, if I have 200 lines of items of different length, the text to column feature would sometimes put data in adjacent cells overwriting information already in those cells
What I need the function to do is, upon selecting the data
1) Only the numbers remain
2) Only the text after the numbers remain.
Hence Why I would prefer two separate macros.
I would really appreciate your help with this.