#1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a function to search a range for a number and... NECCExcel Excel Worksheet Functions 2 November 18th 05 09:14 PM
Create a function between sheets Ryan Excel Discussion (Misc queries) 1 September 23rd 05 06:52 PM
Need a ISWorkday Function -- Any Ideas Mark Excel Worksheet Functions 5 March 29th 05 01:58 AM
Using CONCATENATE function to create email addresses from a list Almamba Excel Worksheet Functions 2 January 23rd 05 09:10 PM
How do I create a multi formula IF function in Excel? Wazza Excel Worksheet Functions 8 November 8th 04 09:25 PM


All times are GMT +1. The time now is 06:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"