Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Custom function for Sum Product (Conditional Formula)

I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)
End Function

How to give it a correct and complete form?

Thanx!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Custom function for Sum Product (Conditional Formula)

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, sSTRING)
MyFormula = Application.Caller.Parent.Evaluate( _
"SUMPRODUCT(--(" & ARRAY1.Address & "=""" & sSTRING & """),--(" & _
ARRAY2.Address & "0)," & ARRAY3.Address & ")")
End Function


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"FARAZ QURESHI" wrote in message
...
I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)
End Function

How to give it a correct and complete form?

Thanx!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Custom function for Sum Product (Conditional Formula)

THANX BOB!!!!!!!!!!!!!

U really made my problems solved!

I am really sorry for double posting but I was actually receiving no
response and had presumed that it might have been overlooked!

Thanx again buddy!

"Bob Phillips" wrote:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, sSTRING)
MyFormula = Application.Caller.Parent.Evaluate( _
"SUMPRODUCT(--(" & ARRAY1.Address & "=""" & sSTRING & """),--(" & _
ARRAY2.Address & "0)," & ARRAY3.Address & ")")
End Function


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"FARAZ QURESHI" wrote in message
...
I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)
End Function

How to give it a correct and complete form?

Thanx!




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
Sum Product Function Maybe lostinformulas Excel Worksheet Functions 6 June 27th 06 12:51 AM
Conditional Sum Product Ben010 Excel Discussion (Misc queries) 12 June 15th 06 06:23 PM
Custom function to simplify Index(match)) formula Martin Excel Discussion (Misc queries) 0 March 20th 06 02:45 PM
product function spiderman Excel Worksheet Functions 1 August 9th 05 08:26 PM
product function spiderman Excel Worksheet Functions 2 May 11th 05 01:14 PM


All times are GMT +1. The time now is 05:18 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"