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 DESIRED

Hello every1!

Can anyone devise me a piece of code to formulate a custom function like:
MyRate(Array1,Array2,Criteria)

To work for a function like:
=SUMPRODUCT(--(A1:A20="A"),B1:B20,C1:C20)/SUMPRODUCT(--(A1:A20="A"),B1:B20)

As:
MyRate(A1:A20,B1:B20,"A")

All your assistance and expertise shall be highly obliged.

Thanx in advance!!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default CUSTOM FUNCTION DESIRED

How do you intend to pass the C1:C20 part of the argument?



On Nov 26, 1:28 pm, FARAZ QURESHI
wrote:
Hello every1!

Can anyone devise me a piece of code to formulate a custom function like:
MyRate(Array1,Array2,Criteria)

To work for a function like:
=SUMPRODUCT(--(A1:A20="A"),B1:B20,C1:C20)/SUMPRODUCT(--(A1:A20="A"),B1:B20)

As:
MyRate(A1:A20,B1:B20,"A")

All your assistance and expertise shall be highly obliged.

Thanx in advance!!!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default CUSTOM FUNCTION DESIRED

U R quite right Iliace!

Sorry 4 replying late but I was bz in my exams.

How can u devise a custom function like:
MyRate(A1:A20,B1:B20,C1:C20,"A")

"iliace" wrote:

How do you intend to pass the C1:C20 part of the argument?



On Nov 26, 1:28 pm, FARAZ QURESHI
wrote:
Hello every1!

Can anyone devise me a piece of code to formulate a custom function like:
MyRate(Array1,Array2,Criteria)

To work for a function like:
=SUMPRODUCT(--(A1:A20="A"),B1:B20,C1:C20)/SUMPRODUCT(--(A1:A20="A"),B1:B20)

As:
MyRate(A1:A20,B1:B20,"A")

All your assistance and expertise shall be highly obliged.

Thanx in advance!!!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default CUSTOM FUNCTION DESIRED

Hello,

If I understand you correctly you need an AVERAGEIF function:
http://www.bettersolutions.com/excel...E725811811.htm

Regards,
Bernd
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default CUSTOM FUNCTION DESIRED

Thanx Bernd,

An xclent site recommendation, 4 sure!!! But! it is actually the code for
usage of conditional Sumproduct( ) that I require! Just want to know how can
I it! Any sample code would be tremendously helpful! If u could refer 2 me
such another sample for the usage of "sumproduct(--(xyz))"?

Thanx again pal!!!

"Bernd P" wrote:

Hello,

If I understand you correctly you need an AVERAGEIF function:
http://www.bettersolutions.com/excel...E725811811.htm

Regards,
Bernd



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default CUSTOM FUNCTION DESIRED

Hello,

Function myrate(rcond, _
rweight, _
rsum, _
scond As String) As Double
'Reverse(moc.liborplus.www) V0.1
Dim i As Long, n As Long, rcomp

With Application.WorksheetFunction
n = rcond.Count
rcomp = rsum
For i = 1 To n
rcomp(i, 1) = -(rcond(i).Value = scond)
Next i

myrate = .SumProduct(rcomp, rweight, rsum) / _
.SumProduct(rcomp, rweight)
End With

End Function

Regards,
Bernd
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default CUSTOM FUNCTION DESIRED

WOW!

THANX PAL!

GREAT!

Can't find words appropriate enough to express my gratitude!

Thanx Again!

"FARAZ QURESHI" wrote:

Hello every1!

Can anyone devise me a piece of code to formulate a custom function like:
MyRate(Array1,Array2,Criteria)

To work for a function like:
=SUMPRODUCT(--(A1:A20="A"),B1:B20,C1:C20)/SUMPRODUCT(--(A1:A20="A"),B1:B20)

As:
MyRate(A1:A20,B1:B20,"A")

All your assistance and expertise shall be highly obliged.

Thanx in advance!!!

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
which function can get the desired result? ADK Excel Worksheet Functions 3 May 9th 07 03:10 PM
IRR desired return izbix Excel Worksheet Functions 3 May 3rd 07 06:47 AM
Simplicity is Desired natei6 Excel Worksheet Functions 8 April 11th 06 07:10 AM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Linking across worksheets not working as desired Steve Excel Worksheet Functions 0 April 27th 05 10:30 AM


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