Get parent folder path from file path using cell formula

This works. =MID(A1,1,LEN(A1)-LEN(MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,”\”,CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1,”\”,””))))+1,LEN(A1)))) The above was my original answer. Neil simplified the expression somewhat and posted this as a comment below: =LEFT(A1,FIND(“?”,SUBSTITUTE(A1,”\”,”?”,LEN(A1)-LEN(SUBSTITUTE(A1,”\”,””))))) This takes advantage of the fact that ? is a forbidden character in paths so that “?” can safely be used instead of CHAR(1) as a placemark, thus improving readability a little bit. … Read more

Excel Reference To Current Cell

Several years too late: Just for completeness I want to give yet another answer: First, go to Excel-Options -> Formulas and enable R1C1 references. Then use =CELL(“width”, RC) RC always refers the current Row, current Column, i.e. “this cell”. Rick Teachey’s solution is basically a tweak to make the same possible in A1 reference style … Read more

Using built-in spreadsheet functions in a script

Google Apps Script is a subset of JavaScript, spreadsheet functions are currently not supported. For example, if you want to create a function that returns today’s date you should write : function test_today(){ return new Date() }// note that this will eventually return a value in milliseconds , you’ll have to set the cell format … Read more