Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default Searching a cells contents?

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default Searching a cells contents?

Awesome.
Thank you very much! :-)

"JE McGimpsey" wrote:

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?


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
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
Searching in another workbook for a string and returning with the contents of the cell next to it. [email protected] Excel Worksheet Functions 1 January 12th 07 07:50 PM
Searching for string in other cells Ruatha Excel Worksheet Functions 3 June 9th 06 10:42 PM
Is there any way of searching for duplicate cells? Lisa Excel Discussion (Misc queries) 1 October 3rd 05 09:19 AM
Searching for text in cells Matt Excel Discussion (Misc queries) 1 January 31st 05 03:16 AM


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