LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Formula Using WorksheetFunction


Here is my data

and the Location is range defined for two areas under City and
Headcount for the areas under Headcount

That hardcoding of Location is not required ,i was testing the code


Survey 1 Survey 2
City Headcount City Headcount
NY 1 NY 1
NY 2 CA 1
TX 0 TX 1
NY 5 NY 1
TX 4 CA 1
TX 0 TX 0

I have similiar function wriiten for SUMIF and it's working fine


Code:
--------------------
Function MySumIf(rng As range, strCriteria As String, rng_sum As range) As Long
Dim sum As Long
For i = 1 To range("Location").Areas.Count
sum = sum + WorksheetFunction.SumIf(rng.Areas(i), strCriteria, rng_sum.Areas(i))
Next i
MySumIf = sum
End Function
--------------------




Thanks
Xcelion


--
xcelion
------------------------------------------------------------------------
xcelion's Profile: http://www.excelforum.com/member.php...o&userid=16287
View this thread: http://www.excelforum.com/showthread...hreadid=485839



 
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
Array formula SUMIF with 2D sum_range array Rich_84 Excel Worksheet Functions 3 April 3rd 09 10:46 PM
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
Find specific value in array of array formula DzednConfsd Excel Worksheet Functions 2 January 13th 09 06:19 AM
Tricky array formula issue - Using array formula on one cell, then autofilling down a range aspenbordr Excel Programming 0 July 27th 05 03:59 PM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM


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