I have below data structure in excel.
Name Order Date Purchage amount
Ramesh 1/1/2017 465
Ramesh 1/2/2017 6543
Ramesh 1/3/2017 34
Ramesh 1/4/2017 31
Shankar 1/2/2017 89
Shankar 1/3/2017 44
Yuvraj 1/1/2017 545
Yuvraj 1/1/2017 77
Yuvraj 1/2/2017 851
Yuvraj 1/3/2017 115
Yuvraj 1/4/2017 67
Yuvraj 1/5/2017 90
Yuvraj 1/6/2017 920
Based on above i want to create summary report as below with VBA.
Name Count >=2/1/2017 And <= 5/1/2017 Purchase Sum >=2/1/2017 And <= 5/1/2017 CV for sum>=2/1/2017 And<= 5/1/2017
Ramesh 3 6608 ??
Shankar 2 133 ??
Yuvraj 4 1123 ??
Based on Name and date criteria, Sum and count can be handle easily with Countifs and sumifs inside VBA too but for CV(Coefficient of variation of purchase amount {C Column here} in above example ), I might have to define range dynamically and avoid zeros and calculate. But have no idea for defining dynamic range. Please help me. Actually i want to use dynamic range for the purpose because i can extend some some things with dynamic range.
Bookmarks