LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default SumProduct, Match in a UDF

SumProduct & Match in a UDF

I have a w-sheet of queried data that will max at about 60 columns and
27,000 rows. Am experimenting w/ SumProduct formulas as a means to sum data
based on multiple criteria, but am having trouble translating them into VBA.
(Want to go VBA route to simplify for users). My questions:
1) Have read in the postings that SumProduct may be a memory hog, end up
being slow for users. Is that true?? If yes, blow the below questions off,
and kindly suggest a different VBA solution than below, pls. If the answer
is no, this is what Im up against:
2) Heres an example of a worksheet formula Im currently (successfully)
using, but am having trouble getting into VBA
=SUMPRODUCT(--(ISNUMBER(MATCH(Org,zh6A,0))),--(ISNUMBER(MATCH(Acct,SelectedAccts,0))),Actual12)
Org = named range of approx 27,000 rows, 1 column on the main data sheet
talked about above. Data can be either numeric or string, includes
duplicates.
zh6A = named range of approx 200 rows, 1 column on a separate sheet.
Numeric or string data, no duplicates.
Acct = another named range of approx 27,000 rows, 1 column on the main data
sheet. Data can be either numeric or string, includes duplicates.
SelectedAccts = named range of approx 50 rows, 1 column on a separate sheet.
Numeric or string data, no duplicates.
Actual12 = another named range of approx 27,000 rows, 1 column on the main
data sheet. Data is numeric, no dups.
3) Heres the UDF Ive come up with so far (returns the #Value error):
Function ARES(ROrgs, RAccts, DataType_Mo)
Dim Org
Org = Worksheets("Data").Range("Org")
Dim Acct
Acct = Worksheets("Data").Range("Acct")
ARES = Evaluate( "SumProduct(--(IsNumber(Match(" & Org & "," & ROrgs & _
",0))),--(IsNumber(Match(" & Acct & "," & RAccts & ",0)))," & DataType_Mo &
"))

My plan is for the users to be able to provide named ranges of data for the
UDF arguments (e.g., the zh6A named range for the ROrgs argument), and then
the Org and Acct variables are named ranges that will already be defined in
the w-book and always used in the UDF. Thanks much for anyones help.

--
BillW
 
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
Sumproduct/match problem Ken Excel Worksheet Functions 2 December 2nd 09 06:43 PM
maybe match, maybe sumproduct hmmmmmm [email protected] Excel Worksheet Functions 3 October 21st 09 09:45 AM
Index match within sumproduct Bony Pony[_2_] Excel Discussion (Misc queries) 2 February 11th 09 12:11 PM
Sumproduct with Match and Vlookup? adimar Excel Worksheet Functions 8 February 5th 08 11:09 PM
Vlookup, match, or sumproduct? Phrank Excel Worksheet Functions 1 July 28th 06 07:15 AM


All times are GMT +1. The time now is 01:21 AM.

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"