Search for Blanks in cell

Archijs

New Member
Joined
Jul 30, 2009
Messages
37
I have the folowing problem. I have a cell which contains text and somewhere within that text is a reference number. The reference numbers look like this:
ZBR-0001
ZMR-0002 etc.

I want to exract thar number in another cell. At first i was using the following formula: =MID(A1,FIND("-",A1)-3,8) and it seemed to work fine.

The problem i encountered was that some of the reference numbers might be up to 10 symbols and would look like this:

ZMZ-0003.1
ZNS-0004.2 etc.


I want to know if i can use the same formula that i had only in stead of "8", i would like to have something that indicated the number of characters until the next blank symbol.

I hope i made it clear enough :)
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Forgot to mention that i was considering using something like this to get the desired result:

=IF(MID(H96,FIND("-",H74)+5,1)=".",MID(H96,FIND("-",H74)-3,10),MID(H96,FIND("-",H74)-3,8))

However this formula is only a part of a larger and i did not want to make it even more unreadable than it already is.
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,894
Members
452,948
Latest member
Dupuhini

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