ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Put Conditional Sums in macros (https://www.excelbanter.com/excel-programming/344780-how-put-conditional-sums-macros.html)

Alan P

How to Put Conditional Sums in macros
 
I am trying to use a macro to ad a conditional sum and am unable to do it or
decipher the VBA (alleged) help section. Usingthe wizard while in the macro
didn't work and I can't figure out a syntax that works. Can anyone point me
inthe right direction?

Thanks,

Alan

Tom Ogilvy

How to Put Conditional Sums in macros
 
Range("A1").FormulaArray = "=Sum(if((B1:B200=5)*(C1:C2006),1,0))"

--
Regards,
Tom Ogilvy


"Alan P" wrote in message
...
I am trying to use a macro to ad a conditional sum and am unable to do it

or
decipher the VBA (alleged) help section. Usingthe wizard while in the

macro
didn't work and I can't figure out a syntax that works. Can anyone point

me
inthe right direction?

Thanks,

Alan





All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com