Comparing columns and returning value

[Closed]
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
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 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
802
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.