Interesting formula or macro for a n00b

BustedAvi

New Member
Joined
Jun 24, 2010
Messages
27
Hi all,

First off, let me say I am no expert whatsoever in VBA or any type of excel formulas. I know the basics well, but my problem here is way passed my ability to program. I hope someone doesn't mind help me out :).

Here it goes.

I have column A and column B.

I would like a formula or macro that would enable me to know if a value in column A that appears more than once (say in rows 1 and 2 for example) corresponds to identical values in column B.

For example.

If
A1 = 1
A2 = 2
A3 = 2
A4= 1
and
B1 = X
B2 = Y
B3 = Z
B4 = X

I'd like it to tell me that:
- value "1" in column A matches value "X" twice
-value "2" in column A matches value "Y" once
-value "2" in column A matches value "Z" once

Or, more simply, maybe just:
-value "1" in column A matches 2 identical values
-value "2" in column A matches 2 non-identical values

I realize this might be a lot to ask, but counting the occurrences by hand has become extremely time consuming! I would be eternally grateful!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
It is not the most elegant solution, but it should work.

In column C, concatenate column A and B, i.e. in cell C1 type in
=a1&b1

Then pivot column C, and put it in say, column D.
In cell E1 type in
=countif(c:c,d1)

Lastly, do auto filter on column E for values greater than 1.
 
Upvote 0
wow njimack,
that was so quick.

I'm having trouble with it though.
I've pasted your formula and dragged it down column C, but I'm getting values of 0's???

I think the problem may be that I forgot to mention that values in column A can appear in column B, but column A will never equal column B.

I took a snapshot of my data.

Capture.jpg
 
Upvote 0
Highlight column C and do Find&Replace.

Find: $4
Replace: $23 (or whatever is the last row of your data)
 
Upvote 0
Wow, awesome!
Thanks a million.

Now I have to do the same comparing column B to column A.
My thoughts were to just reverse the columns in a new sheet, and use the same formula.

Unless if theres an easier way to see both comparisons side by side?
 
Upvote 0
I have to apologize.
It seems I became overly excited.

This formula is useful for telling me how many times Ax matches with Bx, but what I really need is a more categorical approach.

For example, If one matches with a specific other all the time, result = unique
If one matches with more than one other = multiple.

I'm so sorry for being a bit slow at this.
 
Upvote 0
Anyone have a clue how i could organize this?

If you refer to the image i posted, I need to know how many times a value in column A matches with different unique values in column B, and vice versa.

For example, if you look at P209 in column A, I need it to tell me it pairs with 4 unique values in column B (namely, P277, P287,P217, P278, but I only need a total #) and that P209 in column B pairs with 2 values in column A ( namely, P13, P208).

Any suggestions are welcome.
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top