Comparing columns and returning value

Closed
Gunhild - Jan 11, 2012 at 05:38 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Jan 12, 2012 at 10:08 PM
Hello,

I have an spreadsheet where I want to compare values between two columns and return the value from the relating row in a third column. If A1 is found in B1:6, return value in column C from the row in which A1 was found.
Is this possible? I have a macro that does this, but returns only a statement in a chosen column, I would need it to return the corresponding value from column D - and I'm really not good at this!
Any help would be much appreciated!

Example:

A B C D
2 5706631000253 5706631000253 Text 1 Text1
3 5706631000376 5706631000260 Text 2
4 5706631000482 5706631000338 Text 3
5 5706631002301 5706631000376 Text 4 Text 2
6 5706631003643 5706631000390 Text 5



1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Jan 12, 2012 at 10:08 PM
there is a logical problem

A2 is available in B4 ok
but your condition is
quote
from the row in which A1 was found.
unquote
then in text 2 is in the second row and NOT in the fourth row.

If necessary change the logic

in D1 type this fo=formula or copy paste

=IF(COUNTIF($B$1:$B$5,A1)>0,C1,"")

and copy D1 down.
0