Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default checking the content of a cell if it starts with certain character

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default checking the content of a cell if it starts with certain character

=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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default checking the content of a cell if it starts with certain character

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
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
Checking for cell content danhattan Excel Programming 6 April 2nd 07 11:48 PM
Checking a String's last character Ren Excel Programming 6 August 2nd 06 06:04 PM
Checking to see whether a string contains a certain character ajitpalsingh200[_21_] Excel Programming 1 November 26th 04 09:36 AM
Checking for non-numerical content in a cell Tom Ogilvy Excel Programming 0 August 15th 03 10:54 PM
split cell content without using a specific character/sign Donald Lloyd Excel Programming 0 July 31st 03 11:10 PM


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