Formula problem Excel

KOE NATE 0 Reputation points
2024-10-29T14:39:36.5666667+00:00

Can you please help me? I have a table where columns A and B are combinations of 12 to 19 numbers, and I need to obtain the common number between columns A and B.

Any help is appreciated.

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Barry Schwarz 3,746 Reputation points
    2024-10-30T01:33:38.0733333+00:00

    Assuming you want the common number to appear in another cell, you can do this relatively simply in a macro function.Select the area in column A. Hold down the control key and select the area in column B. This produces a selection range with two areas. In the target cell, invoke the macro.

    The macro simply loops through the first area. For each cell, it loops through the second area. If it finds a match, that is the common value. If not, it repeats this loop for the next cell in the first area. If no match is found at all, it returns an error value of your choice, such as #NA.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.