Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Create new function
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. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Create new function
Yes.
You can create your own functions (call UDFs) in Visual Basic. -- Gary''s Student " wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create a function to search a range for a number and... | Excel Worksheet Functions | |||
Create a function between sheets | Excel Discussion (Misc queries) | |||
Need a ISWorkday Function -- Any Ideas | Excel Worksheet Functions | |||
Using CONCATENATE function to create email addresses from a list | Excel Worksheet Functions | |||
How do I create a multi formula IF function in Excel? | Excel Worksheet Functions |