want "I9" to be automatic with "B" Column. I9 will calculate days of current or previous starting day which is shown in B Column. and if a month is not listed than add total days of that month. If B6 contains month after B5(BY=june and B5=may) then Days of divided into two parts First part : total day before that day 2nd part: total days after that day Else If B6 not contains month after B5 then total day of that month will be shown
@Safiq220 You labelled your question with Excel for Web and Office365. If you are not restricted to Excel for the Web alone, you might want to play around with regular pivot tables (columns A:E) or Power Query (columns G:I).
The attached file demonstrate both methods (somewhat simplified).
The PQ solution comes closest to your requirement and it is relatively easy to adapt to your real situation.