Need help figuring out how to use AVERAGEIFS on a range of values modified by another cell

bradleyp2005

New Member
Joined
Feb 6, 2017
Messages
3
I have a data set with home listings, and I'm trying to answer the question, "For homes in inventory at the end of a given month, how many days have they been on the market on average?"

Data specifics: Column A:Location Column W:List Date Column X: Close Date Column

I need to average the days a home has been in inventory at the end of a given month. I.e...home is listed on 1/1/2016, and closed on 2/15/2016. I need this row to use 31 in the average calculation. The idea would be like this (which isn't a viable formula, but hopefully it makes sense):


=AVERAGEIFS(EOMONTH(C$28,0)-'MLS Data'!$W:$W'MLS Data'!$A:$A),Branch_Filter,'MLS Data'!$W:$W,"<="&EOMONTH(C$28,0),'MLS Data'!$X:$X,">"&EOMONTH(C$28,0))

where C$28 is the beginning of the month in my summary table.

This is the last component to a month-long project and my brain is fried, so hopefully someone out there smarter than I can help me out!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I need to average the days a home has been in inventory at the end of a given month. I.e...home is listed on 1/1/2016, and closed on 2/15/2016. I need this row to use 31 in the average calculation. The idea would be like this (which isn't a viable formula, but hopefully it makes sense):
01/01/201601/02/201601/03/201601/04/201601/05/201601/06/201601/07/201601/08/201601/09/201601/10/201601/11/201601/12/201601/01/201701/02/2017
31/01/201629/02/201631/03/201630/04/201631/05/201630/06/201631/07/201631/08/201630/09/201631/10/201630/11/201631/12/201631/01/201728/02/2017
homelistedclosed
home101/01/201615/02/20163115000000000000
home225/01/201612/03/20167291200000000000
home327/02/201620/04/20160331200000000000
col D
formula in D3 (the 31 in home1 row)
=IF($C6<D$3,0,IF(AND($B6<D$3,$C6>D$4),D$4-D$3+1,IF(AND($B6<=D$3,$C6>=D$4),D4-D3+1,IF(AND($B6<=D$3,$C6<D$4),$C6-D$3+1,IF(AND($B6>D$3,$B6<=D$4,$C6>D$4),D$4-$B6+1,IF(AND($B6>D$3,$C6<=D$4),$C6-$B6+1,0))))))
you can now determine average times for each house on the market
and how many houses were on the market in a given month

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
The formula in D3 in your example could just be D$2-$B2;

But what I'm going for is a formula that avoids the 12 columns needed for the Days calculation presented here.

I'm guessing it's just not possible.
 
Upvote 0
Formula in D3 would need* to be D$2-B$2 to capture the total days in inventory for that home through the end of a given month.
 
Upvote 0
but if as in the case of home 1 the time period is spread over several months, it depends what you want - eg do you just want time on books for a given month end ?
 
Upvote 0

Forum statistics

Threads
1,216,124
Messages
6,128,993
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top