For the example below, I want to generate rows for each product as much as the dates between "Date 2" and "Date 1" and have a fourth column to include each unique day between "Date 2" and "Date 1" in these rows.
This is the input

and this is the desired output

By now, I have inserted the below formula to D2 (Dates column). This will generate the desired dates values from "Date In" to "Date Out". However, for this formula to work each product number line should be duplicated to a total count of (Date Out-Date In+1). This is where I'm stuck.
=IF(A1<>A2;B2;D1+1)
Note that there are hundreds of product code with different date values in the original data.
Thanks in advance!




FILTER()formula if you haveExcel365with dynamic array formulas.