none
Excel Macro Help RRS feed

  • Question

  • I am wondering if someone would be able to help me with a macro for Excel.  I am looking to compare two different columns and where they match they take the data from a third cell and update a blank cell.  Here is an example to better explaint it.  Column A and C has numbers I want to compare and where they match up I want to take the number in Column B that is associated with Column A and place it in the blank cell in column D that is associated with that same number in Column C.  I have about 700 records I need to compare 

    Column A      Column B     Column C    Column D

    1233434      9999999       1324141      

    1324141      9999988       1233434      

    • Edited by DanS Friday, September 21, 2012 7:10 PM
    Friday, September 21, 2012 7:07 PM

Answers

  • You can use a formula for that: assuming that the data start in row 2, enter the following formula in D2:

    =IFERROR(VLOOKUP(C2, $A$2:$B$700, 2, FALSE), "")

    Adjust the range A2:B700 as needed.

    Fill down as far as needed.


    Regards, Hans Vogelaar

    • Marked as answer by DanS Friday, September 21, 2012 9:21 PM
    Friday, September 21, 2012 7:58 PM