Re: SUM(IF..... in Visual basic
From: JE McGimpsey (jemcgimpsey_at_mvps.org)
Date: 02/18/04
- Next message: Robert11: "Embedding A Spreadsheet Into A WORD Document, & Updating Of Question ?"
- Previous message: Frank Kabel: "Re: Data validation"
- In reply to: Tom: "SUM(IF..... in Visual basic"
- Next in thread: Tom: "Re: SUM(IF..... in Visual basic"
- Reply: Tom: "Re: SUM(IF..... in Visual basic"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Feb 2004 09:05:57 -0700
It's certainly possible, but would have a horrendous disadvantage in
both speed and memory. In general, using VBA is much slower than using
XL's built-in compiled and optimized functions.
There is a speed advantage to using SUMPRODUCT() rather than SUM(IF()),
though (Note: SUMPRODUCT is not array-entered):
=SUMPRODUCT(--(DataStore!$I$4:$I$39=$E$24),
--(DataStore!$E$4:$E$39=$F$9), DataStore!J$4:J$39)
In article <40328723$0$21298$cc9e4d1f@news.dial.pipex.com>,
"Tom" <reply@list.com> wrote:
> I have a simple sumif that does two conditional test:
>
>
>
> =SUM(IF(('DataStore'!$I$4:$I$39=$E24)*('DataStore'!$E$4:$E$39=$F$9),'DataSto
> re'!J$4:J$39))
>
>
>
> Is it possible to turn this into a generic user defined function :
>
> SumMatchInArray(DataStoreToSum,
> Condtion1Case,Condtion1Test,Condtion2Case,Condtion2Test.Condtion3Case,Condti
> on3Test,etc)
>
>
>
> If so does this have a memory advantage?
>
>
>
> Can some one point me in the direction of an example... I'm new to VB and
> excel programming.
- Next message: Robert11: "Embedding A Spreadsheet Into A WORD Document, & Updating Of Question ?"
- Previous message: Frank Kabel: "Re: Data validation"
- In reply to: Tom: "SUM(IF..... in Visual basic"
- Next in thread: Tom: "Re: SUM(IF..... in Visual basic"
- Reply: Tom: "Re: SUM(IF..... in Visual basic"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|