Thread: Function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Function

Function ShiftHours(a, b, c, d, e)

ShiftHours = Evaluate("SumProduct(--(" & a & "=" & _
b & "), --(" & c & "=" & d & "), " & e & ")")

End Function


Would be the basic approach. the contents of the variables would have to be
consistent with that approach to foster success.

--
Regards,
Tom Ogilvy



"ceemo" wrote:


I have been trying to create my own function whilst including other
functions. Please see below example


Function ShiftHours(a, b, c, d, e)

ShiftHours = SumProduct(--(a = b), --(c = d), e)

End Function

This however doesnt work. Can i use functions within functions?

If so how would i use an aray function that would normaly require me to
use shift&Control&Enter at the same time


--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=558846