A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Formula Question



 
 
Thread Tools Display Modes
  #1  
Old May 14th, 2010, 09:15 PM posted to microsoft.public.excel.misc
Nikki
external usenet poster
 
Posts: 341
Default Formula Question

What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)

  #2  
Old May 14th, 2010, 09:28 PM posted to microsoft.public.excel.misc
Brad
external usenet poster
 
Posts: 943
Default Formula Question

one way
=right(a1,5)

This assume that your information is in a1
--
Wag more, bark less


"Nikki" wrote:

What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)

  #3  
Old May 14th, 2010, 09:40 PM posted to microsoft.public.excel.misc
Jim Thomlinson
external usenet poster
 
Posts: 2,641
Default Formula Question

Assuming the format and text lenght of the ID to always be the same then
=MID(A1, 15, 5)
If you need to seach for the text between the last _ and the first balnk
then we need to get a bit fancy...
--
HTH...

Jim Thomlinson


"Nikki" wrote:

What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)

  #4  
Old May 14th, 2010, 09:40 PM posted to microsoft.public.excel.misc
Reeza
external usenet poster
 
Posts: 35
Default Formula Question

On May 14, 1:15*pm, Nikki wrote:
What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)


If (John Doe) is part of the text.....

=MID(B10, LEN(B10)-FIND(" (", B10,1)+6, 5)

If the _XXXXXX is variable length you need a different approach
though.
  #5  
Old May 14th, 2010, 09:43 PM posted to microsoft.public.excel.misc
Jim Thomlinson
external usenet poster
 
Posts: 2,641
Default Formula Question

Here is the fancy version...

=LEFT(MID(A1, FIND("^", SUBSTITUTE(A1, "_", "^",
LEN(A1)-LEN(SUBSTITUTE(A1,"_",""))))+1, 256), FIND(" ", MID(A1, FIND("^",
SUBSTITUTE(A1, "_", "^", LEN(A1)-LEN(SUBSTITUTE(A1,"_",""))))+1, 256)))
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Assuming the format and text lenght of the ID to always be the same then
=MID(A1, 15, 5)
If you need to seach for the text between the last _ and the first balnk
then we need to get a bit fancy...
--
HTH...

Jim Thomlinson


"Nikki" wrote:

What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)

  #6  
Old May 14th, 2010, 09:45 PM posted to microsoft.public.excel.misc
Lars-Åke Aspelin[_4_]
external usenet poster
 
Posts: 74
Default Formula Question

On Fri, 14 May 2010 13:15:01 -0700, Nikki
wrote:

What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)


The following formula will pull characters 15 to 19 from the string in
A1:

=MID(A1,15,5)

Is that what you need?

The following formula will pull all characters between the rightmost
"_" and the next " ", assuming the result is within the 30 first
characters of the string:

=MID(A1,MAX(IF(MID(A1,ROW(1:30),1)="_",ROW(1:30))) +1,FIND(" ",
MID(A1,MAX(IF(MID(A1,ROW(1:30),1)="_",ROW(1:30)))+ 1,
MAX(IF(MID(A1,ROW(1:30),1)="_",ROW(1:30)))+1))-1)

Note this is an array formula that must be confirmed by
CTRL+SHIFT+ENTER rather than just ENTER.

Is that what you want?

As you see, you have to provide more information on the possible
format of the original string in order not to have us to guess what
you mean and to propose a formula that is as simple as possible, but
still working.

Hope this helps / Lars-Åke

  #7  
Old May 15th, 2010, 01:02 AM posted to microsoft.public.excel.misc
Ron Rosenfeld
external usenet poster
 
Posts: 3,719
Default Formula Question

On Fri, 14 May 2010 13:15:01 -0700, Nikki
wrote:

What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)


To extract the value between the last underscore, and the following space:

=TRIM(LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(
A1,"_",REPT(" ",99)),99))," ",REPT(" ",99)),99))

--ron
  #8  
Old May 15th, 2010, 10:49 PM posted to microsoft.public.excel.misc
Shane Devenshire[_3_]
external usenet poster
 
Posts: 3,333
Default Formula Question

Don't need a formula:
1. Select the data
2. Choose Data, Text to Columns
3. Select Delimited, Next
4. Check Space and add _ to Other, then click Next
5. Highlight each column in the Data Preview pane that you don't want and
turn on the option Do not import (Skip) and click finish.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Nikki" wrote:

What formula could I use to pull 03275 from the below contents of a cell?

EA_1045_02949_03275 (John Doe)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.