Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions?

Hi there,

Is there a way to get WorksheetFunction.CountIf and .SumIf to work wit
2 conditions?

I know how to use

SUMPRODUCT((xRg/aCondition)*(yRg/bCondition))

and

SUMPRODUCT((xRg/aCondition)*(yRg/bCondition)*(zRg to count))

in Excel, but could not find a way to translate this into VBA code...


Thanks a lo

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions?

Etien,

SUMPRODUCT won't work as a worksheetfunction, you need to evaluate the
formula

Evaluate("=SumProduct((A1:A3 =""X"")*(B1:B3=""Y""))")


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Etien " wrote in message
...
Hi there,

Is there a way to get WorksheetFunction.CountIf and .SumIf to work with
2 conditions?

I know how to use

SUMPRODUCT((xRg/aCondition)*(yRg/bCondition))

and

SUMPRODUCT((xRg/aCondition)*(yRg/bCondition)*(zRg to count))

in Excel, but could not find a way to translate this into VBA code...


Thanks a lot


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions?

Works great!

It was a bit tough to include my range variables (!) in there, but i
works now.

Thanks a lo

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions?

I'm glad. I had to leave you some of it to do<vbg

Regards

Bob

"Etien " wrote in message
...
Works great!

It was a bit tough to include my range variables (!) in there, but it
works now.

Thanks a lot




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
WorksheetFunction help Ayo Excel Discussion (Misc queries) 2 July 20th 08 10:48 PM
WorksheetFunction.CountIf & Worksheet.SumIf with 2 conditions? Etien Excel Programming 0 January 12th 04 06:11 PM
WorksheetFunction Mike Fogleman Excel Programming 2 January 1st 04 11:17 PM
WorksheetFunction Stuart[_10_] Excel Programming 3 November 13th 03 12:33 AM
worksheetfunction devnext Excel Programming 1 October 29th 03 12:48 PM


All times are GMT +1. The time now is 11:07 AM.

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"