Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2016, 05:58 AM
funkyfido funkyfido is offline Substring to return numbers Windows XP Substring to return numbers Office 2007
Novice
Substring to return numbers
 
Join Date: Jun 2013
Posts: 24
funkyfido is on a distinguished road
Default Substring to return numbers

I have the following cell of text bRef:0261322cRef:0261322TestDate

I want to extract the numbers between bRef: and cRef: ie.0261322


This string is of characters is not always the same length. I am using the formula below but it won't work as it's numbers being returned. Any ideas on how to do this?

=MID(N4,FIND("Bref:",N4)+4,(FIND("Cref:",N4)-(FIND("Bref:",N4)+4)))
Reply With Quote
  #2  
Old 07-22-2016, 08:04 AM
xor xor is offline Substring to return numbers Windows 10 Substring to return numbers Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

=mid(n4,find(":",n4)+1,find(":",n4,find(":",n4)+1)-5-find(":",n4))
Reply With Quote
  #3  
Old 07-22-2016, 08:07 AM
funkyfido funkyfido is offline Substring to return numbers Windows XP Substring to return numbers Office 2007
Novice
Substring to return numbers
 
Join Date: Jun 2013
Posts: 24
funkyfido is on a distinguished road
Default

I cannot use just the colon as I have many colons in the string. I need to search for the specific text.
Reply With Quote
  #4  
Old 07-22-2016, 08:48 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Substring to return numbers Windows 7 64bit Substring to return numbers Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,771
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

The easy way:
Ctrl+H
Replace what :"bRef:" (no quotes)
With : (leave empty)
Replace All
Ctrl+H
Replace what :"cRef:*" (no quotes)
With : (leave empty)
Replace All
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #5  
Old 07-22-2016, 10:03 AM
xor xor is offline Substring to return numbers Windows 10 Substring to return numbers Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Then maybe:

=MID(N4,FIND(A1,N4)+LEN(A1)+1,FIND(A2,N4)-LEN(A2)-2)

where A1 = bRef and A2 = cRef.
Reply With Quote
Reply

Tags
substring



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I edit my TOC to reference the section numbers instead of the page numbers??? mikey386 Word 0 12-17-2014 02:34 PM
Search a cell that contains words and numbers and convert the numbers to metric Carchee Excel Programming 36 10-08-2014 03:16 PM
How to change the formatting of numbers without changing the numbers? sullengirl Word 2 01-27-2014 03:06 PM
How do I refer to page numbers, when the numbers change as I prepare the document? StevenD Word 5 11-29-2012 12:52 AM
Substring to return numbers Page Numbers Not Matching Chapter Numbers gracie5290 Word 1 02-02-2012 11:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft