Thanks for your reply. I have edited this post to illustrate my requirements properly.
Please visit this post again.
1 of 1 people found this helpful
In this case, you need a bit change of your calculation as shown below
And the result
An updated workbook attached for your reference.
Hope this helps