Formula to extract numbers between two characters?

MariaR323

New Member
Joined
Sep 13, 2017
Messages
12
I have the following data for HS & College and I'd like to extract only the HS Year as shown below:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]HS & College[/TD]
[TD]HS Year (Result I want)[/TD]
[/TR]
[TR]
[TD]HS Year: 2001/Univ Year: 2006[/TD]
[TD]2001[/TD]
[/TR]
[TR]
[TD]HS Year:1997/Univ Year:2005[/TD]
[TD]1997[/TD]
[/TR]
</tbody>[/TABLE]

Is there a formula to achieve this? Noting that the original entries in the column HS & College can have a space or not after the first colon.

Any help would be appreciated as I'm brain fried at the moment.

Thanks!
Maria
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
If the wording is always the same...

=0+LEFT(TRIM(SUBSTITUTE(A1,"HS Year:","")),4)
 
Upvote 0
If the wording is always the same...

=0+LEFT(TRIM(SUBSTITUTE(A1,"HS Year:","")),4)


Unfortunately, I just realized there's a lot of older records that the entry format was not the same and looks like the wording will not always be the same and some entries were made abbreviating Year to Yr.

Any way to rework the formula to account for this?
 
Upvote 0
Unfortunately, I just realized there's a lot of older records that the entry format was not the same and looks like the wording will not always be the same and some entries were made abbreviating Year to Yr.

Any way to rework the formula to account for this?
Give this a try...

=0+RIGHT(LEFT(A1,FIND("/",A1)-1),4)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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