Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default return a value of specific text within a sentence

Is there a function for: If a column contains certain text/sentence, return the value of the specific text?

examples:

A1: 961-San Francisco Giants 1 -25 962-Arizona Diamondbacks
A2: 963-Los Angeles Dodgers 1 PK 964-San Diego Padres
A3: 966-New York Yankees 1 L 965-Baltimore Orioles
A4: 974-Minnesota Twins 1 +5 973-Chicago White Sox

I only want to get:

A6: 1 -25
A7: 1 PK
A8: 1 L
A9: 1 +5

thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default return a value of specific text within a sentence

Hi,

Am Sun, 22 Jun 2014 11:46:06 +0100 schrieb top00001:

A1: 961-San Francisco Giants 1 -25 962-Arizona Diamondbacks
A2: 963-Los Angeles Dodgers 1 PK 964-San Diego Padres
A3: 966-New York Yankees 1 L 965-Baltimore Orioles
A4: 974-Minnesota Twins 1 +5 973-Chicago White Sox

I only want to get:

A6: 1 -25
A7: 1 PK
A8: 1 L
A9: 1 +5


in A6 try:
=MID(A1,FIND(" 1",A1)+1,IF(ISNUMBER(FIND(LEFT(A1,3)+1,A1)),FIND(L EFT(A1,3)+1,A1),FIND(LEFT(A1,3)-1,A1))-FIND(" 1",A1)-2)
and copy down


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
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
Nested formula to search a text string and return specific text Barbie Excel Worksheet Functions 10 February 21st 09 08:40 AM
What function do I use to return a certain value for specific text marjoryann Excel Discussion (Misc queries) 4 June 30th 06 12:00 AM
adjacent to a specific sentence Pivotrend Excel Discussion (Misc queries) 1 February 8th 06 02:35 AM
adjacent to a specific sentence Pivotrend Excel Discussion (Misc queries) 2 February 7th 06 11:04 PM
Any formula to shorten sentence to a specific length supercloudbug Excel Worksheet Functions 5 April 15th 05 02:13 AM


All times are GMT +1. The time now is 03:32 PM.

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"