ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   not sure what is wrong (https://www.excelbanter.com/excel-worksheet-functions/126035-not-sure-what-wrong.html)

Alex H

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""))))"



Bill Kuunders

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""))))"




Sandy Mann

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""))))"




Alex H

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""))))"






Sandy Mann

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""))))"








[email protected]

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.


[email protected]

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.


Alex H

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""))))"





All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com