Day calculation in Ms Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-1620956%22%20slang%3D%22en-US%22%3EDay%20calculation%20in%20Ms%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620956%22%20slang%3D%22en-US%22%3Ewant%20%22I9%22%20to%20be%20automatic%20with%20%22B%22%20Column.%20I9%20will%20calculate%20days%20of%20current%20or%20previous%20starting%20day%20which%20is%20shown%20in%20B%20Column.%20and%20if%20a%20month%20is%20not%20listed%20than%20add%20total%20days%20of%20that%20month.%3CBR%20%2F%3EIf%20B6%20contains%20month%20after%20B5(BY%3Djune%20and%20B5%3Dmay)%20then%3CBR%20%2F%3EDays%20of%20divided%20into%20two%20parts%3CBR%20%2F%3EFirst%20part%20%3A%20total%20day%20before%20that%20day%3CBR%20%2F%3E2nd%20part%3A%20total%20days%20after%20that%20day%3CBR%20%2F%3EElse%3CBR%20%2F%3EIf%20B6%20not%20contains%20month%20after%20B5%20then%20total%20day%20of%20that%20month%20will%20be%20shown%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1620956%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1621353%22%20slang%3D%22en-US%22%3ERe%3A%20Day%20calculation%20in%20Ms%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1621353%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F775647%22%20target%3D%22_blank%22%3E%40Safiq220%3C%2FA%3E%26nbsp%3BYou%20labelled%20your%20question%20with%20Excel%20for%20Web%20and%20Office365.%20If%20you%20are%20not%20restricted%20to%20Excel%20for%20the%20Web%20alone%2C%20you%20might%20want%20to%20play%20around%20with%20regular%20pivot%20tables%20(columns%20A%3AE)%20or%20Power%20Query%20(columns%20G%3AI).%3C%2FP%3E%3CP%3EThe%20attached%20file%20demonstrate%20both%20methods%20(somewhat%20simplified).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20PQ%20solution%20comes%20closest%20to%20your%20requirement%20and%20it%20is%20relatively%20easy%20to%20adapt%20to%20your%20real%20situation.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor
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
1 Reply

@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.