#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default Excel Functions

I need a function that will pull a character value from a specified cell and
string location so I can put it into an if statement to return a text string.

i.e.
Say I have this text string, AP10-FG1A1P, and I wanted to pull the value of
the 8th character. What do I use?

Find and Search are not returning the value, but only the position.
Right and Left return too many characters. Although they are good for the
first and last character value when needed.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Excel Functions

Have you tried Mid, as in:
=mid(1,8,1)

Regards,
Fred.

"Charlie" wrote in message
...
I need a function that will pull a character value from a specified cell
and
string location so I can put it into an if statement to return a text
string.

i.e.
Say I have this text string, AP10-FG1A1P, and I wanted to pull the value
of
the 8th character. What do I use?

Find and Search are not returning the value, but only the position.
Right and Left return too many characters. Although they are good for the
first and last character value when needed.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Excel Functions

try this

=MID(A1,8,1)

Mike

"Charlie" wrote:

I need a function that will pull a character value from a specified cell and
string location so I can put it into an if statement to return a text string.

i.e.
Say I have this text string, AP10-FG1A1P, and I wanted to pull the value of
the 8th character. What do I use?

Find and Search are not returning the value, but only the position.
Right and Left return too many characters. Although they are good for the
first and last character value when needed.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Excel Functions

Do you consider the 8th character to be the "1", counting the dash:

=Right(Left(a1,8))

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Charlie" wrote in message
...
I need a function that will pull a character value from a specified cell and
string location so I can put it into an if statement to return a text
string.

i.e.
Say I have this text string, AP10-FG1A1P, and I wanted to pull the value of
the 8th character. What do I use?

Find and Search are not returning the value, but only the position.
Right and Left return too many characters. Although they are good for the
first and last character value when needed.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default Excel Functions

Perfect Guys, Thanks!

"Mike H" wrote:

try this

=MID(A1,8,1)

Mike

"Charlie" wrote:

I need a function that will pull a character value from a specified cell and
string location so I can put it into an if statement to return a text string.

i.e.
Say I have this text string, AP10-FG1A1P, and I wanted to pull the value of
the 8th character. What do I use?

Find and Search are not returning the value, but only the position.
Right and Left return too many characters. Although they are good for the
first and last character value when needed.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default Excel Functions

Now that I am able to pull the value of the character out of the string. I
need to use an IF statement to have TRUE/FALSE text returned.

=IF(MID(M3,8,2)=1,"1/8 NPT","1/4 NPT") This returns a False value, would you
know why?
M3 = AP10-FG1A1P

"Mike H" wrote:

try this

=MID(A1,8,1)

Mike

"Charlie" wrote:

I need a function that will pull a character value from a specified cell and
string location so I can put it into an if statement to return a text string.

i.e.
Say I have this text string, AP10-FG1A1P, and I wanted to pull the value of
the 8th character. What do I use?

Find and Search are not returning the value, but only the position.
Right and Left return too many characters. Although they are good for the
first and last character value when needed.


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Excel Functions

Two reasons:

*FIRST*
Your formula is wrong!
It's returning "1A".

You should use:

=MID(M3,8,1)
OR
=Right(Left(M3,8))

*SECOND*

Text functions return TEXT, *not* true numbers.

=Right(Left(M3,8))
AND
=MID(M3,8,1)

Will return "1" *not* 1.

So, you *either* make the text formula return a true number:

=--Right(Left(M3,8))
=IF(--Right(Left(M3,8))=1,"1/8 NPT","1/4 NPT")
AND
=--MID(M3,8,1)
=IF(--MID(M3,8,1)=1,"1/8 NPT","1/4 NPT")

OR

You revise your IF() formula to look for a TEXT "1":

=IF(MID(M3,8,1)="1","1/8 NPT","1/4 NPT")
=IF(Right(Left(M3,8))="1","1/8 NPT","1/4 NPT")
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"Charlie" wrote in message
...
Now that I am able to pull the value of the character out of the string. I
need to use an IF statement to have TRUE/FALSE text returned.

=IF(MID(M3,8,2)=1,"1/8 NPT","1/4 NPT") This returns a False value, would you
know why?
M3 = AP10-FG1A1P

"Mike H" wrote:

try this

=MID(A1,8,1)

Mike

"Charlie" wrote:

I need a function that will pull a character value from a specified cell
and
string location so I can put it into an if statement to return a text
string.

i.e.
Say I have this text string, AP10-FG1A1P, and I wanted to pull the value
of
the 8th character. What do I use?

Find and Search are not returning the value, but only the position.
Right and Left return too many characters. Although they are good for
the
first and last character value when needed.




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
Multiple functions, conditional functions HeatherBelle Excel Worksheet Functions 7 October 17th 08 03:57 PM
How to convert cell formula functions to code functions Adnan Excel Discussion (Misc queries) 1 October 1st 08 08:30 PM
formula/functions for average and if functions Petu71 Excel Worksheet Functions 2 August 5th 07 08:25 PM
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Nesting functions in the functions dialog box cs170a Excel Worksheet Functions 0 June 10th 05 10:36 PM


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