Solved

Returns a numbers from a string

Posted on 2014-07-30
9
164 Views
Last Modified: 2014-07-30
I have a string "115 CS 575840" that I need to return the 6 numbers that are together. So, from this string I need to return 575840.
0
Comment
Question by:dgravitt
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 13

Expert Comment

by:duncanb7
ID: 40229351
Is it what your want ?

MID(yourtext,LEN(yourtext)-5,6)

Duncan
0
 
LVL 19

Expert Comment

by:Montoya
ID: 40229359
if your last numbers are always six digits you can try this:

=NUMBERVALUE(RIGHT(B3,6))

this takes the text in column B3 and takes the 6 digits from the end, and converts them to a number value
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 40229403
this should do it

trim(mid(yourString,instrrev(yourString," ")))
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:dgravitt
ID: 40229417
The 6 numbers could be at the end, beginning or middle. I need to pull out the 6 no matter where they are.
0
 

Author Comment

by:dgravitt
ID: 40229431
Rey, yours works well except the case where there are only 6 numbers in the field. Then it returns an error.
0
 

Author Comment

by:dgravitt
ID: 40229462
CS is not always part of it
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40229475
If always next to "CS"
=MID(A1,FIND("CS",A1)+3,6)

Duncan
0
 

Author Closing Comment

by:dgravitt
ID: 40229523
I found a work around to handle the records where it just contained 6 numbers, and Rey, your solution handled the rest.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40229534
dgravitt,
cool, but next time, it will be helpful if all scenario about the data is available.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question