how do I use only 2 characters in a field in a formula

R

rgarner

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.
 
G

Glenn

rgarner said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top