ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   nested if contains a syntax error because of a "." (https://www.excelbanter.com/excel-discussion-misc-queries/157086-nested-if-contains-syntax-error-because.html)

Janis

nested if contains a syntax error because of a "."
 
=if(left(C2,4),ur01,12.13.145.166,if(left(C2,4),ur 02
,12.13.145.167,if(left(C2,4) ,ur03,13.12.145.168, ""), ""), "")

I want to put the right IP address in the cell if if the Cn cell matches the
right modem. It is stopping on the modem number, is that because there is a
"." in the IP number? How can I escape it?

tia,

Pranav Vaidya

nested if contains a syntax error because of a "."
 
Hi Janis,
I thin enclose your IP address in "" like, "12.13.145.166".

HTH,
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"Janis" wrote:

=if(left(C2,4),ur01,12.13.145.166,if(left(C2,4),ur 02
,12.13.145.167,if(left(C2,4) ,ur03,13.12.145.168, ""), ""), "")

I want to put the right IP address in the cell if if the Cn cell matches the
right modem. It is stopping on the modem number, is that because there is a
"." in the IP number? How can I escape it?

tia,


Toppers

nested if contains a syntax error because of a "."
 
IS this what you mean ...

=IF(LEFT(C2,4)="ur01","12.13.145.166",IF(LEFT(C2,4 )="ur02","12.13.145.167",IF(LEFT(C2,4)="ur03","13. 12.145.168","")))

"Janis" wrote:

=if(left(C2,4),ur01,12.13.145.166,if(left(C2,4),ur 02
,12.13.145.167,if(left(C2,4) ,ur03,13.12.145.168, ""), ""), "")

I want to put the right IP address in the cell if if the Cn cell matches the
right modem. It is stopping on the modem number, is that because there is a
"." in the IP number? How can I escape it?

tia,


Dave Peterson

nested if contains a syntax error because of a "."
 
You have to surround text with double quotes: "

=if(left(C2,4)="ur01","12.13.145.166",
if(left(C2,4)="ur02","12.13.145.167",
if(left(C2,4)="ur03","13.12.145.168", "")))

And it's better to copy your formula attempt from the formula bar and paste it
into your message. It'll avoid typos while composing the message.

Janis wrote:

=if(left(C2,4),ur01,12.13.145.166,if(left(C2,4),ur 02
,12.13.145.167,if(left(C2,4) ,ur03,13.12.145.168, ""), ""), "")

I want to put the right IP address in the cell if if the Cn cell matches the
right modem. It is stopping on the modem number, is that because there is a
"." in the IP number? How can I escape it?

tia,


--

Dave Peterson


All times are GMT +1. The time now is 08:01 AM.

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