Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2011, 01:40 AM
OTPM OTPM is offline Extract Numbers from Alphanumeric String Windows 7 32bit Extract Numbers from Alphanumeric String Office 2010 32bit
Expert
Extract Numbers from Alphanumeric String
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default Extract Numbers from Alphanumeric String

Hi All
I am looking for a formula that will extract the first number from an alphanumeric string that may have more than one number contained inside the string. For example I want to be able to extract "360" only from the following alphanumeric string:



360FS+6wks

Any help would be appreciated.
Tony
Reply With Quote
  #2  
Old 05-12-2011, 04:24 AM
macropod's Avatar
macropod macropod is offline Extract Numbers from Alphanumeric String Windows 7 32bit Extract Numbers from Alphanumeric String Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Tony,

Is there any consistency in the data, such a the '+'?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-12-2011, 05:14 AM
OTPM OTPM is offline Extract Numbers from Alphanumeric String Windows 7 32bit Extract Numbers from Alphanumeric String Office 2010 32bit
Expert
Extract Numbers from Alphanumeric String
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi Macropod
Unfortunately not. The varying examples are as follows:
2FS+3 wks
22FS+3 wks
222FS+3 wks etc
Tony
Reply With Quote
  #4  
Old 05-12-2011, 06:42 AM
macropod's Avatar
macropod macropod is offline Extract Numbers from Alphanumeric String Windows 7 32bit Extract Numbers from Alphanumeric String Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Tony,

Your reply suggests all the data do have a '+' and, apparently, a 'F' immediately after the number. Is either of these so?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-12-2011, 06:45 AM
OTPM OTPM is offline Extract Numbers from Alphanumeric String Windows 7 32bit Extract Numbers from Alphanumeric String Office 2010 32bit
Expert
Extract Numbers from Alphanumeric String
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi Macropod
Each entry may either have an "+" or a "-" and it will either be an F or an S.
Reply With Quote
  #6  
Old 05-12-2011, 06:51 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Extract Numbers from Alphanumeric String Windows 7 32bit Extract Numbers from Alphanumeric String Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

If the number is always immediately followed by an "F" or an "S", then you could use this formula:
Code:
=LEFT(A1,MIN(SEARCH({"F","S"},A1&"FS")-1))
__________________
Colin

RAD Excel Blog
Reply With Quote
  #7  
Old 05-13-2011, 12:52 AM
OTPM OTPM is offline Extract Numbers from Alphanumeric String Windows 7 32bit Extract Numbers from Alphanumeric String Office 2010 32bit
Expert
Extract Numbers from Alphanumeric String
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Quote:
Originally Posted by Colin Legg View Post
If the number is always immediately followed by an "F" or an "S", then you could use this formula:
Code:
=LEFT(A1,MIN(SEARCH({"F","S"},A1&"FS")-1))
Hi Colin
Brilliant. It works fine (better than the formula I used that tok me about 2 hours to work out :-)).
Thanks for your help.
Tony
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to extract only numbers from a STRING? Learner7 Excel 3 07-02-2013 06:25 AM
Extract Numbers from Alphanumeric String Can't See Attachments When E-mail String is Saved to PDF wineattorney Outlook 1 03-29-2011 02:15 AM
Extract numbers from a text string aleale97 Excel 4 02-10-2011 10:33 AM
inserting a string of data into an MS Word table??? matto Word VBA 0 07-16-2010 09:35 AM
Extract from String using Wildcard whousedmy Word 0 05-21-2009 01:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:14 AM.


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