#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default RIGHT function

In one column I have City State and Zip info. In a nearby column I am
attempting to extract data simply the state and zip. For example in the
first column I have "Clanton, AL 35045". I am attempting to simply put "AL
35045" In a second column. The function I am using is
"=RIGHT(C2,FIND(",",C6,1)". The way I understand this is that I am telling
it to extract everything after the comma. The function works for all
information in cities with seven letters (like Clanton). For all cities with
more or less letters it doesn't function properly (more likely I wrote the
function wrong!). For exammple "Tuscaloosa, AL 35404" extracts as "a, AL
65404" Anyone show me what I am doing wrong here?! Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default RIGHT function

Hi,

Try this
=MID(A1,FIND(",",A1,1)+1,LEN(A1))

or if that's always a space after the comma try this
=MID(A1,FIND(" ",A1,1)+1,LEN(A1))


Mike

"Help" wrote:

In one column I have City State and Zip info. In a nearby column I am
attempting to extract data simply the state and zip. For example in the
first column I have "Clanton, AL 35045". I am attempting to simply put "AL
35045" In a second column. The function I am using is
"=RIGHT(C2,FIND(",",C6,1)". The way I understand this is that I am telling
it to extract everything after the comma. The function works for all
information in cities with seven letters (like Clanton). For all cities with
more or less letters it doesn't function properly (more likely I wrote the
function wrong!). For exammple "Tuscaloosa, AL 35404" extracts as "a, AL
65404" Anyone show me what I am doing wrong here?! Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default RIGHT function


"=RIGHT(C2,FIND(",",C6,1)"?

1) why are you cutting from C2 and based on what you find after a
comma in C6?

2) try: =RIGHT(C2,LEN(C2) - FIND(",",C2,1)-1)


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default RIGHT function

THank you, that worked perfectly. Can you explain what you did enlieu of
what I was doing?

"Mike H" wrote:

Hi,

Try this
=MID(A1,FIND(",",A1,1)+1,LEN(A1))

or if that's always a space after the comma try this
=MID(A1,FIND(" ",A1,1)+1,LEN(A1))


Mike

"Help" wrote:

In one column I have City State and Zip info. In a nearby column I am
attempting to extract data simply the state and zip. For example in the
first column I have "Clanton, AL 35045". I am attempting to simply put "AL
35045" In a second column. The function I am using is
"=RIGHT(C2,FIND(",",C6,1)". The way I understand this is that I am telling
it to extract everything after the comma. The function works for all
information in cities with seven letters (like Clanton). For all cities with
more or less letters it doesn't function properly (more likely I wrote the
function wrong!). For exammple "Tuscaloosa, AL 35404" extracts as "a, AL
65404" Anyone show me what I am doing wrong here?! Thanks



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default RIGHT function

LEN function shows the length of a cell

i.e. using it in yr formula you base the result on the cell's length

otherwise you always cut the same number of characters from the cell
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default RIGHT function

You were finding the comma correctly but but then taking that many characters
from the right so your formula only worked if the comma was central i.e. 8
from the left an 8 from the right.

The correct way to use right is shown in your other replies but I chose to
use MID
i.e. find the comma in the same way as you did and then take every thing
form that mid position(+1). Using len(a1) ensured I took enough characters.

Mike

"Help" wrote:

THank you, that worked perfectly. Can you explain what you did enlieu of
what I was doing?

"Mike H" wrote:

Hi,

Try this
=MID(A1,FIND(",",A1,1)+1,LEN(A1))

or if that's always a space after the comma try this
=MID(A1,FIND(" ",A1,1)+1,LEN(A1))


Mike

"Help" wrote:

In one column I have City State and Zip info. In a nearby column I am
attempting to extract data simply the state and zip. For example in the
first column I have "Clanton, AL 35045". I am attempting to simply put "AL
35045" In a second column. The function I am using is
"=RIGHT(C2,FIND(",",C6,1)". The way I understand this is that I am telling
it to extract everything after the comma. The function works for all
information in cities with seven letters (like Clanton). For all cities with
more or less letters it doesn't function properly (more likely I wrote the
function wrong!). For exammple "Tuscaloosa, AL 35404" extracts as "a, AL
65404" Anyone show me what I am doing wrong here?! Thanks

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default RIGHT function

Assuming you only have 5-digit Zip Codes (never the 9-digit version with the
dash in it), and the fact that postal state abbreviations are always
2-character abbreviations, couldn't you just use this?

=RIGHT(C2, 8)

Rick


"Help" wrote in message
...
In one column I have City State and Zip info. In a nearby column I am
attempting to extract data simply the state and zip. For example in the
first column I have "Clanton, AL 35045". I am attempting to simply put
"AL
35045" In a second column. The function I am using is
"=RIGHT(C2,FIND(",",C6,1)". The way I understand this is that I am
telling
it to extract everything after the comma. The function works for all
information in cities with seven letters (like Clanton). For all cities
with
more or less letters it doesn't function properly (more likely I wrote the
function wrong!). For exammple "Tuscaloosa, AL 35404" extracts as "a, AL
65404" Anyone show me what I am doing wrong here?! Thanks


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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


All times are GMT +1. The time now is 11:22 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"