Insert column3 Value if Column1 match to column2

dcmphi

New Member
Joined
Aug 28, 2022
Messages
13
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
I have three column in excel with value. These are A, B and C. I want to insert value of C column in D if A col value=B col
example:
A B C D
5 5 3 3
2 2 5 5
1 1 0 0
9 9 7 7

Can any one help?
 
Last edited:
I want to say column A and column B is like as database table and i want to query in column B from column D column where column C matches with column A then set column B value as a result in column D. For an Example: column A is student roll and column B is marks. Column C is also student roll. I want to query if column C student roll matches with column A student roll then show marks (column B) in column D as a result.
Please give us some more realistic small sample dummy data with the expected results (filled in manually) with XL2BB and explain again in relation to that sample data.
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Please give us some more realistic small sample dummy data with the expected results (filled in manually) with XL2BB and explain again in relation to that sample data.
I discover the formula. Here is it.
=VLOOKUP(C6,$A$4:$B$9,2,0)
But one problem if C6 value is null it shows #N/A Can i solve it if C6 is null then result shows 0?
 

Attachments

  • Excel.jpg
    Excel.jpg
    43.1 KB · Views: 4
Upvote 0
I discover the formula. Here is it.
=VLOOKUP(C6,$A$4:$B$9,2,0)
But one problem if C6 value is null it shows #N/A Can i solve it if C6 is null then result shows 0?

Excel Formula:
=IFERROR(VLOOKUP(C4,$A$4:$B$9,2,0),"0")

Screenshot 2022-08-29 135542.png
 
Upvote 0
I discover the formula. Here is it.
=VLOOKUP(C6,$A$4:$B$9,2,0)
Well, that is quite a different layout/description to what you originally posted. No wonder the early suggestions did not work for you. 😎

Here are some other options, depending on which of your Excel versions you are actually using for this job and exactly what output you want if column C is empty.

22 08 29.xlsm
ABCDEFGHI
1
2
3
455Passed25failfailfailfail
552fail0 0 
625fail55PassedPassedPassedPassed
754fail689PassedPassedPassedPassed
8689Passed0 0 
9256Passed0 0 
Match (2)
Cell Formulas
RangeFormula
F4:F9F4=IF(C4="",0,VLOOKUP(C4,$A$4:$B$9,2,0))
G4:G9G4=IF(C4="","",VLOOKUP(C4,$A$4:$B$9,2,0))
H4:H9H4=XLOOKUP(C4,A$4:A$9,B$4:B$9,0)
I4:I9I4=XLOOKUP(C4,A$4:A$9,B$4:B$9,"")
 
Upvote 0

Forum statistics

Threads
1,214,414
Messages
6,119,375
Members
448,888
Latest member
Arle8907

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