Extract specific numbers from a text string, and extract range

Status
Not open for further replies.

danpaddy

New Member
Joined
Oct 18, 2018
Messages
3
Hello, this is a bit of an odd query,
I am trying to convert a student timetable into an excel spreadsheet (then create a calendar with it), but the data I have been given is in an awkward format. It would be easier to give an example:

I receive a cell containing a list of weeks a certain class is on as follows (all in one cell)

| A [FONT=&quot]|_______________|[/FONT]
1| 20-32,35,40-41
[FONT=&quot]|_______________|[/FONT]
2| 19
[FONT=&quot]|_______________|[/FONT]
3| 12-20,23 |_______________|

This would mean that the class runs between week 22 and 33, then again on week 35, then 40 to 41. I need to list each class seperately, so want an output to look as follows:

|A |B |C |D |E |F |G |H |I |J |K |L |M |N |O |P |Q |
1|20|21|22|23|24|25|25|26|27|28|29|30|31|32|35|40|41|
2|19|__|__|
[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|
3|12|13|14|15|16|17|18|19|20|23|
[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|[FONT=&quot]__[/FONT]|

Is this possible using a formula or a VBA code?

(The weeks are academic weeks and will then be converted to calender years using VLOOK up?
I know I can do it manually, but I have over 400 rows of dates to sort and could really do with a simple way to do it on mass.

Kind Regards,
Dan.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Duplicate: https://www.mrexcel.com/forum/excel...ecific-numbers-text-string-extract-range.html

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread. Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it. Please be patient and do not attempt to post the question again.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,716
Messages
6,174,069
Members
452,542
Latest member
Bricklin

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