Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default not sure what is wrong

Hi i have the following code for a cell, but if I enter 01752 into RC3,5 I
am getting "Long distance". Can someone tell me what I'm doing wrong

thanks
A

"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 303
Default not sure what is wrong

Why double quotes?

Try

=IF(LEFT(RC3,5)="01752","Local",IF(LEFT(RC3,5
etc.

--
Greetings from New Zealand

"Alex H" wrote in message
...
Hi i have the following code for a cell, but if I enter 01752 into RC3,5
I am getting "Long distance". Can someone tell me what I'm doing wrong

thanks
A

"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default not sure what is wrong

Alex,

RC3,5 is not a cell reference. Do you mean RC[3] ? ie three columns to the
right of the cell that the formula is in

Also I assume that "0845" is actually "01845"

Also I do not understand whay you have double quotes when you should only
have single quotes.


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Alex H" wrote in message
...
Hi i have the following code for a cell, but if I enter 01752 into RC3,5
I am getting "Long distance". Can someone tell me what I'm doing wrong

thanks
A

"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default not sure what is wrong

Hi, No I am obviously getting my perverbials in a twist.
What I was want to is that for the row I am on, if the left 5 chars in
Column 3 = 01548 then local else long ditance
Thanks

Alex

"Sandy Mann" wrote in message
...
Alex,

RC3,5 is not a cell reference. Do you mean RC[3] ? ie three columns to
the right of the cell that the formula is in

Also I assume that "0845" is actually "01845"

Also I do not understand whay you have double quotes when you should only
have single quotes.


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Alex H" wrote in message
...
Hi i have the following code for a cell, but if I enter 01752 into RC3,5
I am getting "Long distance". Can someone tell me what I'm doing wrong

thanks
A

"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default not sure what is wrong

Hi Alex,

Column 3 is "C" so with the formula in Row 5 try:

=IF(LEFT(C5,5)="01752","Local",IF(LEFT(C5,5)="0154 8","Local",IF(LEFT(C5,5)="01803","Local",IF(LEFT(C 5,5)="01845","Local","Long
Distance"))))


A shorter version would be:

=IF(SUM(--(LEFT(C5,5)={"01752","01548","01803","01845"})),"L ocal","Long
Distance")

Note that I am assuming that the 0845 should have been 01845

I am also assuming because of the leading zero that there is other data in
C5 - like "01752 Miles" which would make 01752 text not a number.

If it is actually a number the you don't need the LEFT() function and simply

=IF(C5=1752,"Local",IF(C5=1548,"Local",IF(C5=1803, "Local",IF(C5=1845,"Local","Long
Distance"))))

will work.


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Alex H" wrote in message
...
Hi, No I am obviously getting my perverbials in a twist.
What I was want to is that for the row I am on, if the left 5 chars in
Column 3 = 01548 then local else long ditance
Thanks

Alex

"Sandy Mann" wrote in message
...
Alex,

RC3,5 is not a cell reference. Do you mean RC[3] ? ie three columns to
the right of the cell that the formula is in

Also I assume that "0845" is actually "01845"

Also I do not understand whay you have double quotes when you should only
have single quotes.


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Alex H" wrote in message
...
Hi i have the following code for a cell, but if I enter 01752 into
RC3,5 I am getting "Long distance". Can someone tell me what I'm doing
wrong

thanks
A

"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default not sure what is wrong

Alex H wrote:
Hi i have the following code for a cell, but if I enter 01752 into RC3,5 I
am getting "Long distance". Can someone tell me what I'm doing wrong
[....]
"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"


I assume the double-quotes are an anomaly of the way you wrote the
posting. Otherwise, Excel would flag them as syntax errors.

I suspect you have a numeric value in the cell, not 01752 as text.
Several possible remedies:
1. Format the cell as Text __before__ you enter 01752.
2. Enter '01752 into the cell. Notice the initial apostrophe.
3. Enter ="01752" into the cell.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default not sure what is wrong

Alex H wrote:
Hi i have the following code for a cell, but if I enter 01752 into RC3,5 I
am getting "Long distance". Can someone tell me what I'm doing wrong
[....]
"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"


I presume that the double-quotes are an anomaly of the way you wrote
your posting; otherwise, Excel would flag a syntax error.

I suspect the cell (RC3) contains a numeric value, not text. You can
confirm that by enter =type(RC3) in some cell (but you probably need to
replace "RC3"). Several possible remedies:

1. Format the cell as Text __before__ you enter 01752.
2. Enter '01752. Note the apostrophe.
3. Enter ="01752".

By the way, I suspect that "0845" is a typo. Otherwise, that condition
would be true only when the cell has exactly the text 0845. Your use
of LEFT(,5) implies that you want to allow for more than just 4
characters.

PS: I also presume that your use of RC3 is not root cause of your
problem. The cell reference RC3 works just fine if you have set the
R1C1 option. Otherwise, Excel would flag a syntax error.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default not sure what is wrong

Thanks All

A

"Alex H" wrote in message
...
Hi i have the following code for a cell, but if I enter 01752 into RC3,5
I am getting "Long distance". Can someone tell me what I'm doing wrong

thanks
A

"=IF(LEFT(RC3,5)=""01752"",""Local"",IF(LEFT(RC3,5 )=""01548"",""Local"",IF(LEFT(RC3,5)=""01803"",""L ocal"",IF(LEFT(RC3,5)=""0845"",""Local"",""Long
Distance""))))"



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
Wrong Hyperlink location after sorting Lawulm Excel Discussion (Misc queries) 6 November 17th 06 05:30 PM
Goal Seeker Giving Wrong Answer glenn Excel Discussion (Misc queries) 2 October 19th 06 01:26 PM
Getting wrong values PW Excel Worksheet Functions 5 August 14th 06 11:01 PM
SUMPRODUCT is showing wrong Amount msbutton27 Excel Discussion (Misc queries) 2 January 25th 06 03:40 PM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM


All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"