LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default An AddIn for a custom function

I often come across using a lengthy formula for a data like:

Product Rate Qty
xxxx xx xxx
xxxx xx xxx
xxxx xx xxx
xxxx xx xxx

to calculate the Weighted Average Rate where the conditions are that:

1. Product is "ProductA";
2. Rate exists; and
3. Return "0" to avoid a #DIV/0! error if no such product exists.

Such a formula is:

=IF(ISERR(
SUMPRODUCT(--(A2:A10="ProductA"),B2:B10,C2:C10)/
SUMPRODUCT(--(A2:A10="ProductA"),--(B2:B100),C2:C10)),0,
SUMPRODUCT(--(A2:A10="ProductA"),B2:B10,C2:C10)/
SUMPRODUCT(--(A2:A10="ProductA"),--(B2:B100),C2:C10))

Now I want to create an add-in for a function to be uploaded everytime I
open Excel.

What would be the appropriate piece of code for a function and arguments like:
MyRate(Product, Range1[Product List], Range2[Rate List], Range3[Qty List])
 
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 I know if a file is using a custom addin Rodrigo Ferreira Excel Discussion (Misc queries) 3 September 15th 06 02:44 PM
How I know if a file is using a custom addin Rodrigo Ferreira Excel Worksheet Functions 1 September 15th 06 02:08 AM
Custom Functions saved as addin dbutcher Excel Worksheet Functions 2 April 7th 06 05:24 PM
Custom Function SPeterson Excel Discussion (Misc queries) 3 December 21st 05 07:12 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM


All times are GMT +1. The time now is 02:30 PM.

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

About Us

"It's about Microsoft Excel"