Comparing two columns and return a third

C

casedk

I'm having some trouble. I'd like to compare two columns and return data
from a third column when True.

For example:

Compare column A to Column C - Rows 1-1000. If A1 appears anywhere in
C1-1000 i want to return the "text" in column D. The row in D is = to the
true value in C.

i.e.

If A1=C47 I want to return the text in D47. Then repeat this for A2-A1000.

Thanks
 
P

Pete_UK

Something along these lines, I think - put this formula in D1:

=IF(COUNTIF(A$1:A$1000,C1)>0,C1,"no match")

and copy down.

This is taking the approach:

"if C1 appears anywhere in A1:A1000, then put C1 into D1"

which I think is logically equivalent to what you said.

Hope this helps.

Pete
 
C

casedk

Pete,

Thanks! The countif took care of my issue with not counting the entire
range!

However, I still have the issue with the True statement. If my countif is
true C1 appears somewhere between A1-A1000 I need to know where that "true"
value was in A1-A1000. Was it A1 or A246 or A934 ....

If C1 appears in A246 then I'd like to put D246 in as my true statement.

In my problem A and D are related:
A=id number
B=description (text)

C=random range of id numbers that I need the description (D).

I want to see if C 1 appears anywhere in A 1-1000 (which your formula does).
Once I find a place where C1=Ax I want to take that description Dx and place
it in E1.

So, I think I may need a second formula or need to modify the true statement.


Thanks for you help.
 
P

Pete_UK

You've changed the wording round now from what you originally put. Try
it this way round:

=IF(COUNTIF(C$1:C$1000,A1)>0,A1,"no match")

if column A contains the important "text".

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top