Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How I know if a file is using a custom addin | Excel Discussion (Misc queries) | |||
How I know if a file is using a custom addin | Excel Worksheet Functions | |||
Custom Functions saved as addin | Excel Worksheet Functions | |||
Custom Function | Excel Discussion (Misc queries) | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions |