Split ranges(001-005) but keep the associated column

norriz

New Member
Joined
Aug 14, 2010
Messages
30
I have table with a range of numbers with the associated name(below), need to find a way to split ex:001-005 to 001 and table1, 002 and table1, 003 and table1. Can this be done in access or excel. Help needed urgently. Thank you
NumberName
001-005table1
006-010table2
I'd like my final data to look like this-
Number Name
001 Table1
002 Table1
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Last edited:
Upvote 0
I have excel for Microsoft 365 MSO, I hope thats the right version.
I number ranges varies. You have a few variables like below:
150-154, 156, 160-165, 260, 265, 439- I will like ot break down150-154 but also keep the associated column
360-361, 363-364, 367-368
I dont know VBA if you show me I am sure I can run a query with it.
Thanks Kweaver.

 
Upvote 0
Here's another approach:

MergeCells05202021.xlsm
ABCDEFG
5001-005table1001 table1002 table1003 table1004 table1005 table1
6006-010table2006 table2007 table2008 table2009 table2010 table2
Sheet6
Cell Formulas
RangeFormula
C5:G6C5=TEXT(SEQUENCE(,5,LEFT(A5,3)),"000") & " " & $B5
Dynamic array formulas.
 
Upvote 0
I have excel for Microsoft 365 MSO, I hope thats the right version.
I number ranges varies. You have a few variables like below:
150-154, 156, 160-165, 260, 265, 439- I will like ot break down150-154 but also keep the associated column
360-361, 363-364, 367-368
I dont know VBA if you show me I am sure I can run a query with it.
Thanks Kweaver.
MergeCells05202021.xlsm
ABCDEFG
1NumberName
2001-005table1001 table1002 table1003 table1004 table1005 table1
3006-010table2006 table2007 table2008 table2009 table2010 table2
4150-154table3150 table3151 table3152 table3153 table3154 table3
5156table4156 table4
6260table5260 table5
7367-368table6367 table6368 table6
8439-441table7439 table7440 table7441 table7
Sheet6
Cell Formulas
RangeFormula
C8:E8,C7:D7,C5:C6,C2:G4C2=TEXT(SEQUENCE(,1+RIGHT($A2,3)-LEFT($A2,3),LEFT($A2,3)),"000") & " " & $B2
Dynamic array formulas.


Only need the formula in C2 and fill down.
 
Upvote 0
Thanks Kweaker. I do like your approach, however I did not want to merge the columns,but the results remain the same . Let me take a stab at this and let you know. I appreciate the quick response
 
Upvote 0
Read this as merging them: "ex:001-005 to 001 and table1, 002 and table1, 003 and table1."
Maybe be more specific, then, if this isn't it.
 
Upvote 0
Kweaker, how do you address the situation like this-
301-303, 311, 399 in the same cell. Thank you
 
Upvote 0
First of all, it's "kweaver" not "kweaker".
Then, what determines what goes in what cell? All the 300s, then all the 400s, or what's the logic?
 
Upvote 0
Read this as merging them: "ex:001-005 to 001 and table1, 002 and table1, 003 and table1."
Maybe be more specific, then, if this isn't it.
Sorry for not being more specific .
So here is current state
NumbersDescription
003, 010-043, 045, 048, 050-067, 068-079, 085-089, 100-149, 167, 200-212, 214-241, 243-253, 255-259, 261-264, 266-268, 270-297, 299, 313-317, 320-342, 344, 346-347, 349, 365-366, 369, 387, 389-397, 398, 411-412, 415-416, 700-701, 703-708, 710-714, 716-722, 725-729, 750, 754-759Tables

Future state
NumbersDescription
003tables
010tables
011tables
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,958
Latest member
Hat4Life

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