View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Searching a cells contents?

One way:

C1: =IF(MID(A1,3,1)="A",1,IF(MID(A1,3,1)="B",2,"Error" ))

Or, if the code in A *has* to be either A or B in the third character:

C1: = 2 - (MID(A1,3,1)="A")


In article ,
SteW wrote:

I've got a spreadsheet set up with a code in column A.
The code can have 2 forms, xxAxxxx, or xxBxxxx, where x is a number (eg
12A7586, 34B2875).

In column C, I want a value of 1 or 2, depending on the code type in column A.
Is it possibe to do this automatically, or do I have to go through them
manually?