Compare values in two columns and return the value from third
Closed
Wasim
-
Mar 9, 2016 at 08:02 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Mar 10, 2016 at 07:27 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Mar 10, 2016 at 07:27 AM
Hello,
I've a table containing four columns. If the values in the first two columns match to particular value (eg. A1="xxxx" and B1="yyy"), I need to return the value in the third column to the fourth column.
Can anybody help??? Thanks in advance.
I've a table containing four columns. If the values in the first two columns match to particular value (eg. A1="xxxx" and B1="yyy"), I need to return the value in the third column to the fourth column.
Can anybody help??? Thanks in advance.
Related:
- Compare values in two columns and return the value from third
- Display two columns in data validation list but return only one - Guide
- Tweetdeck larger columns - Guide
- Beyond compare - Download - File management
- If cell contains date then return value ✓ - Office Software Forum
- Based on the values in cells b77 b81 c77 - Excel Forum
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Mar 10, 2016 at 07:27 AM
Mar 10, 2016 at 07:27 AM
suppose data like this
col2 col3 col4 col1
x y f t
w w x s
c t c d
d y v f
x y g u
x y y n
q w m j
e r l k
t y k l
try this macro
col2 col3 col4 col1
x y f t
w w x s
c t c d
d y v f
x y g u
x y y n
q w m j
e r l k
t y k l
try this macro
Sub test()
Dim col1, col2, ccol
Set col1 = Range(Range("A2"), Range("A2").End(xlDown))
For Each ccol In col1
If ccol = "x" And ccol.Offset(0, 1) = "y" Then
ccol.Offset(0, 3) = ccol.Offset(0, 2)
End If
Next ccol
End Sub