Backslash not appearing
Hi there.
I am trying to write an if formula ( =IF([Question 2]@row = "C:\Desktop", 1, 0) ; however, as soon as I hit enter, the formula gets saved as ( =IF([Question 2]@row = "C:Desktop", 1, 0) ). The backslash (\) in the text between the quotation marks won't appear, so the formula becomes wrong. I don't know why the the backslash keeps disappearing.
Thank you
Answers
-
I just tested with a basic IF searching for "\" and got the unparseable error. Removing it to search for "" worked just fine. I've never run across this before.
@Genevieve P @Andrée Starå @Mike Wilday @L@123 Have any of you ever run into this issue? Is there a list somewhere of certain characters that can't be used in formulas? Do we have any ideas for work-arounds?
-
I tried even using a SUBSTITUTE function, but while typing out the formula the "help box" indicated that I was still in the "old text" portion even after finishing it out with a closing parenthesis and everything. When I left the cell it went back to the unparseable error.
-
So the only way I have been able to get it to work is to insert a text/number column and manually enter the \ into the cell. Then in the IF statement you type out the first part, use a cell reference in place of the backslash, then type out the rest.
=IF([Question 2]@row = "C:" + [Backslash Column]@row + "Desktop", 1, 0)
-
@Paul Newcome I have never encountered this before. That is really strange. I wonder if it some kind of anti-javascript code to prevent injections or something. So weird.
-
I did all kinds of testing. It won't even take
="\"
Any formula with a typed \ will either automatically remove it or will return the unparseable error.
-
so strange.
-
Hi @Paul Newcome, @Mike Wilday and @Rodrigue Muhoza
This is strange, and I actually haven't come across this before, personally. However I think this may be happening because \ is the escape character... try adding it in twice?
=IF([Question 2]@row = "C:\\Desktop", 1, 0)
This should keep one \ present with the text.
¯\_(ツ)_/¯
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
@Genevieve P I thought about trying that, but for whatever reason didn't. I guess I should have because that works.
-
Interesting. You could also try to use the unichar reference.
=IF([Question 2]@row = "C:" + Char(47) + "Desktop", 1, 0)
-
@L@123 I'll have to play with that a bit. I forgot about the CHAR/UNICHAR functions.
-
The \ is an escape character Try "\\". The first \ acts as an escape character and allows the 2nd \ to be treated as a regular backslash.
That being said, I wish there was a way to turn it off for static strings.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.8K Get Help
- 410 Global Discussions
- 219 Industry Talk
- 457 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 297 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!