EXCEL Count Unique Values If Criteria Met

- 1 answer

I am trying to achieve a formula that will count unique Batch codes in the same date. So for example Column B (Serial no.) should increase a value if above if any of the rows above with the same date has a different batch code. This is part of a larger code

The code I have so far does quite the opposite and I've tried interchanging the criteria etc. but nothing seems to give me the result that I am after.


Here is a link to an example spreadsheet

I have added a column to show what the expected values should be.

Thank you in advance



What you could try:

enter image description here

Formula in B2:


I'd then use custom number formatting to create the leading zero with: 00.