Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how do I use only 2 characters in a field in a formula

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default how do I use only 2 characters in a field in a formula

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

--
Gary''s Student - gsnu200909
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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)
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
How to delete first three characters in all rows of a field No Name Excel Discussion (Misc queries) 2 March 9th 09 04:43 PM
Text Field in a cell changes characters brewster56 Excel Discussion (Misc queries) 1 November 13th 08 10:24 PM
Looking for alpha characters in a field fgwiii[_2_] Excel Worksheet Functions 1 September 17th 08 12:41 PM
Removing characters from datetime field Sujesh Excel Discussion (Misc queries) 3 July 14th 05 03:22 PM
How do I remove the 1st 4 characters of a field in Excel? MFreeman Excel Worksheet Functions 8 June 12th 05 01:54 PM


All times are GMT +1. The time now is 07:35 AM.

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"