Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Extract multiple results based on multiple criteria tara657 Excel Worksheet Functions 4 January 24th 09 03:35 AM
Using a function to count cells based on multiple criteria Rae Excel Worksheet Functions 1 February 22nd 08 09:34 PM
Function based on multiple criteria from two cell references ibrokit Excel Worksheet Functions 2 October 13th 07 06:57 PM
sum based on multiple criteria Todd Excel Worksheet Functions 3 May 5th 06 10:06 PM
Multiple Sum, based on criteria Andy the yeti Excel Worksheet Functions 4 December 22nd 05 02:32 PM


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