VLOOKUP,
Like all of the lookup functions, returna a single value from the same row as that in which it finds the search value provided for it.
in VLOOKUP, the search may be set to require an exact match or to accept a close match (largest value less than or equal to the search value).
In LOOKUP, 'close match' is the default and only choice.
In MATCH, the formula can be set to look for 'the value' (exact match), 'largest (same as 'close match') or 'smallest (similar to 'close match', but from the other direction—accepting the smallest value greater than or equal to the search value)
Better for what you want would be the COUNTIF function.
Insert a new column after column B. The new column will become column C.
To count the number of times each value in column A appears in column B, enter this formula in C2:
COUNTIF(B,A2)
The formula is entered as shown in cell C2, then filled down to the end of that column,
The formula answers the question "how many times does the value in A2 appear in column B?
If you include a second COUNTIF, and a couple of spaces between the two copies of the function, you can get a count of that value in each of the two columns:
The first digit in column C shows the number of times the value on 'this row' of column A is found in column A (including the one on 'this row'). The second shows the number of tines the value on this row of column A appears in column B.
The 1 0 in row 7 shows that ID-1096 appears only once in the table.
As before, the formula is entered as shown in C2, then filled down to the end of the table
Missing is a count of how many times each value in column B appears in column A and in column B. This could b added to the formula above, but would probably be more easily read and understood if it were in a separate column. The formula is the same as the one in the table above, with B2 replacing each of the A2 values.
Enter in D2, and fill down.
The values in the example table are generated randomly within a range of only 101 possible values to ensure there will be some repeated values to count. The checkbox in cell A1 of the table is there only to trigger the random ID- formula to re-calculate the numbers, and is not required in your table.
Regards,
Barry