PC Review


Reply
Thread Tools Rate Thread

checking the content of a cell if it starts with certain character

 
 
=?Utf-8?B?VGltdXI=?=
Guest
Posts: n/a
 
      1st Aug 2007
I want to calculate something if the content of the reference cell begins
with "PN"
I tried to use "if" formula as below ;
if A2=PN# or * but it did not work

I will be gled if somebody help me
thanks
timur
 
Reply With Quote
 
 
 
 
Bernard Liengme
Guest
Posts: n/a
 
      1st Aug 2007
=IF(LEFT(A2,2)="PN",B2*3,"no way")
=IF(LEFT(A2,2)="PN",B2*3,"")

But IF is not needed if you can live with zero when there is no PN
=(LEFT(A2,2)="PN")*(B2*3)

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Timur" <(E-Mail Removed)> wrote in message
news:349699B6-ADE8-4915-8DF9-(E-Mail Removed)...
>I want to calculate something if the content of the reference cell begins
> with "PN"
> I tried to use "if" formula as below ;
> if A2=PN# or * but it did not work
>
> I will be gled if somebody help me
> thanks
> timur



 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      1st Aug 2007
Sub timur()
v = Selection.Value
If Left(v, 2) = "PN" Then
MsgBox ("found PN")
End If
End Sub
--
Gary''s Student - gsnu200735


"Timur" wrote:

> I want to calculate something if the content of the reference cell begins
> with "PN"
> I tried to use "if" formula as below ;
> if A2=PN# or * but it did not work
>
> I will be gled if somebody help me
> thanks
> timur

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Macro that splits content from cell if given character is found muddan madhu Microsoft Excel Programming 1 26th Oct 2009 03:50 AM
Find and replace a character in a cell with another cell's content JABAgdl Microsoft Excel Programming 1 23rd Sep 2009 02:34 AM
Column Cell character number checking tlee Microsoft Excel Programming 4 19th May 2009 10:47 AM
Checking for cell content =?Utf-8?B?ZGFuaGF0dGFu?= Microsoft Excel Programming 6 2nd Apr 2007 11:48 PM
Re: Checking for non-numerical content in a cell Tom Ogilvy Microsoft Excel Programming 0 15th Aug 2003 10:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:16 PM.