Formula to calculate averages by date intervals

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Formula to calculate averages by date intervals

Post by sathya »

Hi hans and rudi,

Please look at the attachment and any help is much appreciated.

Thanks a lot
sathya
You do not have the required permissions to view the files attached to this post.
Last edited by Rudi on 14 Mar 2016, 15:32, edited 1 time in total.
Reason: Edited by Rudi to give the post a meaningful title

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: formula

Post by HansV »

See the attached version.
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: formula

Post by Rudi »

    
Attached...
auto generator.xlsx
(Oh...Hans pipped me! Take your pick....) :rofl:
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Thanks a lot for your reply. Please look at the attachment. for some reason the formula is not calculation average.

Thanks a lot again hans
You do not have the required permissions to view the files attached to this post.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: formula

Post by Rudi »

You must just check that the formula references include the extra dates you input...
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Thanks for your reply hans.

How does formula generate automatically when ever i go to new line?

Thanks

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: formula

Post by HansV »

This version has formulas up to row 100. If you need more, you can easily modify them.
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Thanks again hans :)

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: formula

Post by Rudi »

I'm certainly not trying to out do Hans, but here is just another option using Excel's tables that have a different and more dynamic reference style.
Tables will also update these dynamically if you add new records to the bottom of the table.
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Hi Hans and Rudi,

Please look at the attachment.

Thanks in advance :)
You do not have the required permissions to view the files attached to this post.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: formula

Post by Rudi »

Attached...
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Hahaha

Hans and Rudi u guys are brilliant. Thanks Rudi :)

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: formula

Post by HansV »

All your previous examples used dates within the current year. You now introduce dates in last year too. The formulas don't take that into account. We have to change them to look at the year as well as at the month.

Apart from that, I don't understand why you changed the formulas in F1:Q1 to use text...

See the attached version.
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Hi hans,
The reason why i changed formula in F1:Q1 is i would like to go via month wise. Say example current month is April : i would like my F1 to start with March and so on. Other example, current month Dec, i would like to start my F1 in Nov at this stage hans. Thats the reason why i changed it. Thanks again.

Other issue is i am pulling information from access to excel with the above attached template. But every time one or two cells in excel is automatically changing its format to dd/mm/yy and not staying with number format. Any idea?

Thanks again

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: formula

Post by HansV »

I understand that you wanted to go back from the current month, but you used =TEXT(..., "mmm"). That was incorrect; it caused the formulas to stop working.

You could apply the correct format after transferring data from Access.
Best wishes,
Hans

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Thanks a lot hans. BTW in the formula cell for calculating average in everymonth we using formula as =IFERROR(AVERAGEIFS(Table1[MARKS],Table1[YEAR],YEAR(H1),Table1[MONTH],MONTH(H1)),""). Is there is any formula for calculating average per week as well?

Thanks a lot

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: formula

Post by HansV »

You can do that by adding a column for the week number. See the attached version.
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Wow. Amazing work. Thanks again

sathya
3StarLounger
Posts: 276
Joined: 17 Dec 2015, 16:28

Re: formula

Post by sathya »

Hans,

You created formula for months and weeks. Is there is any formula for daily as well. Like Mon,Tue,Wed...Sun?

Thanks

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: formula

Post by HansV »

I added another helper column for the day of the week, and used this for the average formula.
auto generator.xlsx
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans