Days on the Market - Conditional Average Days Between 2 Dates

hawaean

New Member
Joined
Aug 25, 2016
Messages
32
Hi Excel Fam,

Here's the challenge I'm stuck on. I have a list of products with a start date and an end date [when available]. I'd like to calculate the average days between the two days for the different categories. When the item is still on the shelf, the end date should be today().

How can I get the average days on the market for:
1. Can Goods
2. Produce

I'd like to avoid any helper columns if possible.

Book1
ABCD
1Shelf DateSale DateType
2Product A13-Jan3-FebCan Good
3Product B2-May4-JunCan Good
4Product C26-Apr21-MayCan Good
5Product D2-Nov8-JanCan Good
6Product E15-Mar30-MarProduce
7Product F1-JunCan Good
8Product G25-Jan2-FebProduce
9Product H7-Feb12-FebProduce
10Product I6-Apr13-MayCan Good
11Product J5-Jan24-MarCan Good
12Product K18-Apr1-JunCan Good
13Product L6-JunProduce
14Product M21-Feb3-MarProduce
15Product N30-May6-JunProduce
16Product O18-Jan8-MarCan Good
Sheet1
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try:
This is an array formula and needs to be entered with CTRL-SHIFT-ENTER unless you are using Excel 365. It helps to let us know what version of Excel you are using.
Book1
ABCDEFG
1Shelf DateSale DateTypeTypeAverage
2Product A1/13/212/3/21Can GoodCan Good40.777778
3Product B5/2/216/4/21Can GoodProduce8.8333333
4Product C4/26/215/21/21Can Good
5Product D11/2/201/8/21Can Good
6Product E3/15/213/30/21Produce
7Product F6/1/21Can Good
8Product G1/25/212/2/21Produce
9Product H2/7/212/12/21Produce
10Product I4/6/215/13/21Can Good
11Product J1/5/213/24/21Can Good
12Product K4/18/216/1/21Can Good
13Product L6/6/21Produce
14Product M2/21/213/3/21Produce
15Product N5/30/216/6/21Produce
16Product O1/18/213/8/21Can Good
Sheet2
Cell Formulas
RangeFormula
G2:G3G2=AVERAGE(IF($D$2:$D$16=F2,IF($C$2:$C$16="",TODAY(),$C$2:$C$16)-$B$2:$B$16))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Thank you. I use Office 365, so this worked without the array trigger. I appreciate the help!
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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