Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom Function-sum based on multiple criteria
I have created a custom function that sums one range of
cells based on criteria in another range: dblIBilling = Application.WorksheetFunction.SumIf (OwnerRange, employee, BillingsRange) Now I need to add two additional criteria from a different range. In essence: Sum "BillingsRange" if "OwnerRange" = employee's name (the part I already have) AND "UnitsRange" = "Hour" or "Over". I'm sure this can be done, and I've tried multiple options but I'm not getting it. Any advise would be appreciated! Rachel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom Function-sum based on multiple criteria
This would require an array formula which you can not really use in VBA
directly. (sumproduct won't work in this instance either). You could set up the formula and use Evaluate to return the value, but it would need a string set up the same way you would enter it in a cell. Otherwise, you need to loop through you range and check for the appropriate conditions. -- Regards, Tom Ogilvy "Rachel" wrote in message ... I have created a custom function that sums one range of cells based on criteria in another range: dblIBilling = Application.WorksheetFunction.SumIf (OwnerRange, employee, BillingsRange) Now I need to add two additional criteria from a different range. In essence: Sum "BillingsRange" if "OwnerRange" = employee's name (the part I already have) AND "UnitsRange" = "Hour" or "Over". I'm sure this can be done, and I've tried multiple options but I'm not getting it. Any advise would be appreciated! Rachel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extract multiple results based on multiple criteria | Excel Worksheet Functions | |||
Using a function to count cells based on multiple criteria | Excel Worksheet Functions | |||
Function based on multiple criteria from two cell references | Excel Worksheet Functions | |||
sum based on multiple criteria | Excel Worksheet Functions | |||
Multiple Sum, based on criteria | Excel Worksheet Functions |