Create new function

K

keyser_Soze

Is it possible to create a function to use in formulas?

I had a function the other day that got quite large as I had to repeat
the same functionality. I would have liked to been able to do
something like:

=IF(<Cell>="","",IF(ISTEXT(<Cell>),IF(LEN(<Cell>)>6,RIGHT(<Cell>,4),"----")&"/"&LEFT(<Cell>,myfunc1(<Cell>)-1)&"/"&MID(<Cell>,myfunc1(<Cell>)+1,SEARCH("/",<Cell>,myfunc1(<Cell>)+1)-myfunc1(<Cell>)-1),TEXT(<Cell>,"yyyy/mm/dd")))


instead of

=IF(<Cell>="","",IF(ISTEXT(<Cell>),IF(LEN(<Cell>)>6,RIGHT(<Cell>,4),"----")&"/"&LEFT(<Cell>,SEARCH("/",<Cell>,1)-1)&"/"&MID(<Cell>,SEARCH("/",<Cell>,1)+1,SEARCH("/",<Cell>,SEARCH("/",<Cell>,1)+1)-SEARCH("/",<Cell>,1)-1),TEXT(<Cell>,"yyyy/mm/dd")))

(although this example wasn't that large, It grew from this)

If it is possible to create my own function, I would like to be able to
reference other cells in the function. For example, myfunc1 may need
to look at the the column preceding the cell reference. Is this even
possible?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top