See the revised version
Regards Rajan verma +91 7838100659 [IM-Gtalk] From: Rajan_Verma [mailto:rajanverma1...@gmail.com] Sent: 13 June 2012 6:37 To: 'excel-macros@googlegroups.com' Subject: RE: $$Excel-Macros$$ Region wise count Hi Loki, Here is a VBA Solution for you, see the attached sheet. Hope you will like it J Function GetCount(rngLookup, rngLookUPValue, Optional VarMatchingCriteria = "") As Integer Dim rngCell As Range Dim rngSum As Range Dim lngResult As Long lngResult = 0 For Each rngCell In rngLookup If rngCell.Value = rngLookUPValue.Value Then Set rngSum = rngCell.Resize(rngCell.Offset(, 4).Value).Offset(, 6).Resize(rngCell.Offset(, 4).Value, 3) lngResult = lngResult + WorksheetFunction.CountIf(rngSum, VarMatchingCriteria) End If GetCount = lngResult If rngCell.Row > Worksheets(rngCell.Parent.Name).UsedRange.Rows.Count Then Exit Function Next End Function Regards Rajan verma +91 7838100659 [IM-Gtalk] From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of Lokesh Loki Sent: 13 June 2012 3:46 To: excel-macros@googlegroups.com Cc: NOORAIN ANSARI Subject: $$Excel-Macros$$ Region wise count Hi Noorain, For small correction, I have modified the data for the attached excel file. And I need "count" formula based on region. Please do the needful, and if you have any clarification let me know. Regards, Lokesh. M Xchanging Technology Services |CBRE - AP Xchanging Tower | SJR iPark | EPIP Area | Whitefield | Bangalore | 560066 (1-800-920-6957) EXT-1648 lokesha.marisidda...@cbre.com| <http://www.cbre.com/> www.cbre.com --- Be Clean, Go Green --- Please consider the environment before printing this message -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ---------------------------------------------------------------------------- -------------------------- To post to this group, send email to excel-macros@googlegroups.com To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com
Copy of Region wise count.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12