View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Glenn Glenn is offline
external usenet poster
 
Posts: 1,240
Default how do I use only 2 characters in a field in a formula

rgarner wrote:
A1 B1
MH*97*14*80 96

I want to us the first 2 characters in A1 in a formula to place a value in B1

If the 1st 2 characters in A1="MH" or "AP" then B1=96 else B1=90

How do I write that formula? (How do I use any of the characters, for
instance, if I want to use the 4th and 5th characters, 97)?

Thanks.



Look at IF(), LEFT(), MID() and OR() in the help file.

=IF(OR(LEFT(A1,2)="MH",LEFT(A1,2)="AP"),96,90)