Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default seperate a value in a text string

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?



--
Thomas
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default seperate a value in a text string

Hi Thomas,

=IF(LEN(A1)=2,1,VALUE(MID(A1,LEN(A1)-4,2)))

should do the job ...

HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default seperate a value in a text string

Will there always be "EA" at the end of the string? If so

=IF(A2="EA", 1, --TRIM(MID(LEFT(A2, LEN(A2) - 2), FIND("%",
SUBSTITUTE(A2,"/","%", LEN(A2) - LEN(SUBSTITUTE(A2,"/",""))))+1, 255)))

appears to work...


In article ,
T Miller wrote:

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default seperate a value in a text string

Nice one JE......and it will accomodate 3 or more place numbers as
well......such as
CS/4 BX/12340 EA


Vaya con Dios,
Chuck, CABGx3


"JE McGimpsey" wrote:

Will there always be "EA" at the end of the string? If so

=IF(A2="EA", 1, --TRIM(MID(LEFT(A2, LEN(A2) - 2), FIND("%",
SUBSTITUTE(A2,"/","%", LEN(A2) - LEN(SUBSTITUTE(A2,"/",""))))+1, 255)))

appears to work...


In article ,
T Miller wrote:

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default seperate a value in a text string

Thank you sooooo much. I wasn't really sure how to put the functions
together to make it all work.
--
Thomas


"Carim" wrote:

Hi Thomas,

=IF(LEN(A1)=2,1,VALUE(MID(A1,LEN(A1)-4,2)))

should do the job ...

HTH
Cheers
Carim




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default seperate a value in a text string

No, it could have cs, pk, etc also, what can you use other than listing them
all out in the IF statement?
--
Thomas


"JE McGimpsey" wrote:

Will there always be "EA" at the end of the string? If so

=IF(A2="EA", 1, --TRIM(MID(LEFT(A2, LEN(A2) - 2), FIND("%",
SUBSTITUTE(A2,"/","%", LEN(A2) - LEN(SUBSTITUTE(A2,"/",""))))+1, 255)))

appears to work...


In article ,
T Miller wrote:

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default seperate a value in a text string

Carim,

What if the value is BX/5 EA, It worked for BX/50 EA but not the other, what
do I need to change in the string to make it work?


--
Thomas


"Carim" wrote:

Hi Thomas,

=IF(LEN(A1)=2,1,VALUE(MID(A1,LEN(A1)-4,2)))

should do the job ...

HTH
Cheers
Carim


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default seperate a value in a text string

There has to be some consistancy in the data in order to write rules into
formulas to allow Excel to extract the desired parts. All of your samples
showed the cells ending in EA, and now you say they all don't........perhaps
if you would give a larger sample of your data, more representative of the
extremes, it would help.

Vaya con Dios,
Chuck, CABGx3



"T Miller" wrote:

No, it could have cs, pk, etc also, what can you use other than listing them
all out in the IF statement?
--
Thomas


"JE McGimpsey" wrote:

Will there always be "EA" at the end of the string? If so

=IF(A2="EA", 1, --TRIM(MID(LEFT(A2, LEN(A2) - 2), FIND("%",
SUBSTITUTE(A2,"/","%", LEN(A2) - LEN(SUBSTITUTE(A2,"/",""))))+1, 255)))

appears to work...


In article ,
T Miller wrote:

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default seperate a value in a text string

CLR,

Very true sir,

I did not relize this until I got the error's. I did get it to work though,
now I just need to combine some rules and statements to make it work as one.
Thanks to all for the help, this was a learning one for me and now I know how
it works.
--
Thomas


"CLR" wrote:

There has to be some consistancy in the data in order to write rules into
formulas to allow Excel to extract the desired parts. All of your samples
showed the cells ending in EA, and now you say they all don't........perhaps
if you would give a larger sample of your data, more representative of the
extremes, it would help.

Vaya con Dios,
Chuck, CABGx3



"T Miller" wrote:

No, it could have cs, pk, etc also, what can you use other than listing them
all out in the IF statement?
--
Thomas


"JE McGimpsey" wrote:

Will there always be "EA" at the end of the string? If so

=IF(A2="EA", 1, --TRIM(MID(LEFT(A2, LEN(A2) - 2), FIND("%",
SUBSTITUTE(A2,"/","%", LEN(A2) - LEN(SUBSTITUTE(A2,"/",""))))+1, 255)))

appears to work...


In article ,
T Miller wrote:

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default seperate a value in a text string

No problem Thomas, I did not mean to sound critical..........I'm glad you got
it working. Please don't hesitate to come back if we can be of any further
assistance.

Vaya con Dios,
Chuck, CABGx3



"T Miller" wrote:

CLR,

Very true sir,

I did not relize this until I got the error's. I did get it to work though,
now I just need to combine some rules and statements to make it work as one.
Thanks to all for the help, this was a learning one for me and now I know how
it works.
--
Thomas


"CLR" wrote:

There has to be some consistancy in the data in order to write rules into
formulas to allow Excel to extract the desired parts. All of your samples
showed the cells ending in EA, and now you say they all don't........perhaps
if you would give a larger sample of your data, more representative of the
extremes, it would help.

Vaya con Dios,
Chuck, CABGx3



"T Miller" wrote:

No, it could have cs, pk, etc also, what can you use other than listing them
all out in the IF statement?
--
Thomas


"JE McGimpsey" wrote:

Will there always be "EA" at the end of the string? If so

=IF(A2="EA", 1, --TRIM(MID(LEFT(A2, LEN(A2) - 2), FIND("%",
SUBSTITUTE(A2,"/","%", LEN(A2) - LEN(SUBSTITUTE(A2,"/",""))))+1, 255)))

appears to work...


In article ,
T Miller wrote:

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default seperate a value in a text string

On Wed, 4 Oct 2006 09:04:02 -0700, T Miller
wrote:

I need to remove a value in a cell and place only that value in the next
cell, example:

Column One Column Two
CS/4 BX/40 EA 40
CS/72 EA 72
EA 1

Is there an IF statement that can do this? I have 1200 rows of these and I
need to just have the last number in column two and where there is text(EA) I
need it to show the number 1? Can this be done?


To extract the last number from a cell, or show a 1 if there no number in the
cell, download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr

This add-in can also be easily distributed with your workbook, if that is a
requirement.


Then use this Regular Expression formula:

=--IF(REGEX.MID(A1,"\d+",-1)="",1,REGEX.MID(A1,"\d+",-1))


--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find & Replace text format jmn13 Excel Discussion (Misc queries) 2 May 25th 06 06:18 PM
Finding specific text in a string Hardip Excel Worksheet Functions 5 April 8th 06 01:16 PM
Remove last character of text string Grant Excel Worksheet Functions 2 September 29th 05 05:17 PM
dynamic cell reference within a text string gvm Excel Worksheet Functions 4 July 25th 05 02:40 AM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM


All times are GMT +1. The time now is 11:19 AM.

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

About Us

"It's about Microsoft Excel"