Show the record count from subtable

Dear Support,

I would like to ask if I want to show the record count from subtable(like countif function) of current product ID. However, I can’t predict what product ID will the user input so that hard code look like “COUNTIF(A4,‘apple’,A4)” outside the subtable is not my objective. So, is there any formula can be used to show as like that? Thanks.

ID count
A 2
A 2
B 3
B 3
B 3

Hi,

I’m afraid there’s no formula could achieve this demand, maybe it need custom script to do the calculation.