View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andy Andy is offline
external usenet poster
 
Posts: 10
Default Problem with nesting an OR in a formula

Not sure exactly what you are after. You can check if the first
character is an F or 0 and drop it with:

=IF(or(LEFT(C10,1)="F",LEFT(C10,1)="0"),"AC"&MID(C 10,2,7),"AC"&MID(C10,1
,7))

However, this only gives you an account number that starts AC and then
has up to 7 digits. Did you want 8 digits with 0's at the beginning (eg
so 1234567 becomes 01234567)? If so, try:

="AC"&TEXT(IF(OR(LEFT(C10,1)="F",LEFT(C10,1)="0"), MID(C10,2,7),MID(C10,1
,7)),"00000000")

Andy

*** Sent via Developersdex http://www.developersdex.com ***