Hello,
I have a set of consumption data, where I am trying to count by 2 months frequency and take an average. Since I have a data from 2012 till date my formula works fine but I am tired doing the loops. Below is the sample of data from what I am trying to achieve.
[TABLE="width: 485"]
<tbody>[TR]
[TD="width: 64, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] "]item
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Jan
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Feb
[/TD]
[TD="width: 49, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Mar
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Apr
[/TD]
[TD="width: 47, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-May
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Jun
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Jul
[/TD]
[TD="width: 48, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Aug
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Sep
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Oct
[/TD]
[TD="width: 49, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Nov
[/TD]
[TD="width: 45, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Dec
[/TD]
[TD="width: 64, bgcolor: #FFC000"]2 months
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]ABC
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]12
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[TD="bgcolor: transparent, align: right"]5
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]4
[/TD]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[TD="bgcolor: transparent, align: right"]1.00
[/TD]
[/TR]
</tbody>[/TABLE]
Formula under the 2months which I have =AVERAGE(COUNTIF(B2:C2,">0"),COUNTIF(C2:D2,">0"),COUNTIF(D2:E2,">0"),COUNTIF(E2:F2,">0"),COUNTIF(F2:G2,">0"),COUNTIF(G2:H2,">0"),COUNTIF(H2:I2,">0"),COUNTIF(I2:J2,">0"),COUNTIF(J2:K2,">0"),COUNTIF(K2:L2,">0"),COUNTIF(L2:M2,">0"))
I am looking for a better formula may be offset function.
I have a set of consumption data, where I am trying to count by 2 months frequency and take an average. Since I have a data from 2012 till date my formula works fine but I am tired doing the loops. Below is the sample of data from what I am trying to achieve.
[TABLE="width: 485"]
<tbody>[TR]
[TD="width: 64, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] "]item
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Jan
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Feb
[/TD]
[TD="width: 49, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Mar
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Apr
[/TD]
[TD="width: 47, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-May
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Jun
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Jul
[/TD]
[TD="width: 48, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Aug
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Sep
[/TD]
[TD="width: 40, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Oct
[/TD]
[TD="width: 49, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Nov
[/TD]
[TD="width: 45, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: right"]1-Dec
[/TD]
[TD="width: 64, bgcolor: #FFC000"]2 months
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]ABC
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]12
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[TD="bgcolor: transparent, align: right"]5
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[TD="bgcolor: transparent, align: right"]4
[/TD]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[TD="bgcolor: transparent, align: right"]1.00
[/TD]
[/TR]
</tbody>[/TABLE]
Formula under the 2months which I have =AVERAGE(COUNTIF(B2:C2,">0"),COUNTIF(C2:D2,">0"),COUNTIF(D2:E2,">0"),COUNTIF(E2:F2,">0"),COUNTIF(F2:G2,">0"),COUNTIF(G2:H2,">0"),COUNTIF(H2:I2,">0"),COUNTIF(I2:J2,">0"),COUNTIF(J2:K2,">0"),COUNTIF(K2:L2,">0"),COUNTIF(L2:M2,">0"))
I am looking for a better formula may be offset function.