Using Excel's FIND feature to find open parentheses.
August 6, 2004 1:55 PM   Subscribe

I need to use Excel's FIND function to locate open-parentheses, but since parentheses are part of the syntax of the function itself, it's choking. How can I escape the character to make this work?
posted by scarabic to Computers & Internet (8 answers total)
 
cut + paste into emacs and turn font-lock-mode on.
posted by andrew cooke at 2:06 PM on August 6, 2004


What will that do?
posted by scarabic at 2:20 PM on August 6, 2004


bugger. sorry, i was thinking of quotes.

ok, to redeem myself - define the parentheses that are used within the function as variables.
posted by andrew cooke at 2:25 PM on August 6, 2004


also, you can normally define your functions to handle both the opening and closing of brackets. if you are careful you can get things so that the parentheses inside the function cancel out. or, if you're using a really brain-dead editor, add appropriate closing.opening parentheses in comments.

hope i've understood this time.
posted by andrew cooke at 2:27 PM on August 6, 2004


Defining them as variables sounds like it might work. Do you mean just placing a "(" in another cell and referencing that cell in my formula? Or is there some other variable mechanism I should use?

Thanks, andrew_cooke.
posted by scarabic at 3:08 PM on August 6, 2004


maybe i'm not understanding either. just whipped up a quick excel spreadsheet and just doing a normal find works for me.

A1: "some example (text)"
B1: =FIND("(",A1,1)

B1 is showing as 14, which is the index of the first "(" character. Is this what you want or am i misunderstanding you?
posted by escher at 3:26 PM on August 6, 2004


(actually i know nothing about excel. those are just tricks from programming in various languages + editors over the years. i'll shut up now...)
posted by andrew cooke at 3:30 PM on August 6, 2004


Crap. You know what? My formula was failing for another reason. Poor diagnosis. My bad. You've got it right, there, escher. I had this:

B1: =FIND("(",A1,0)

That final 0 should have been a 1. Sorry for my confusion!
posted by scarabic at 4:01 PM on August 6, 2004


« Older Any advice for how to shop for a decent couch/sofa...   |   Is it hard to switch to a trackball from using a... Newer »
This thread is closed to new comments.