+ Reply to Thread
Results 1 to 11 of 11

find with vlookup and replace the value

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    8

    find with vlookup and replace the value

    hey there,

    i want to make it very simple.

    example;
    column a has unique numbers. (55000 rows)
    column b has values (some of them empty) - 55000 rows

    column c has unique numbers (column a also have those values) 613 rows
    column d should be replaced with matched cells. 613 rows

    here is the thing;
    example - search C1 within column A. lets say result on 441st row. replace "B441" with "D1" and then search C2 .......

    sorry for very bad explanation. i hope you gonna get it. need a solution very urgent.

    best regards from a newbie..
    Emrah

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: find with vlookup and replace the value

    it sounds like a simple vlookup will work here...
    =vlookup(C1,B:B,1,false)

    if that doesnt work for you, i would suggest that you upload a sample workbook, showing what you are working with, what you're expected outcome is, and how you arrived at that
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: find with vlookup and replace the value

    thanks for quick reply FDibbins.
    but my problem is replacing the cells. i can not enter any formula onto column B. so, i believe it has to be done with VBA.
    i tried lots of formulas, it didn't work.
    on your example, result, only gave me the current value. actually it is =vlookup(C1,A:A,2,FALSE) but how can i integrate a replace thing?

    and sample file is attachedsample_memrah.xlsx
    Last edited by memrah; 11-05-2012 at 01:53 AM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: find with vlookup and replace the value

    that was not a formula for column B, it is only looking into B for the result. that formula goes into D, copied down

    as i said though, if that doesnt work for you, i would suggest that you upload a sample workbook, showing what you are working with, what you're expected outcome is, and how you arrived at that

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: find with vlookup and replace the value

    sample workbook added. yes, it was my bad.
    it must be;
    =VLOOKUP(C1,A:B,2,FALSE)
    sorry

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: find with vlookup and replace the value

    ok you're vlookup() has found 91 in column A and returned zzz from column B. what do you want to happen next?

  7. #7
    Registered User
    Join Date
    11-05-2012
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: find with vlookup and replace the value

    next; replace "zzz" with "a" (matched record on column "D")
    and then find "93" on column A, and replace the returned blank cell from column B with b (which is matched record of column "C" on column "D")

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: find with vlookup and replace the value

    ok, then how about this? put it in E2, copied down
    =IF(ISERROR(VLOOKUP(C2,A:B,2,FALSE)),"",D2)

  9. #9
    Registered User
    Join Date
    11-05-2012
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: find with vlookup and replace the value

    yes this is one of the solutions. thank you.
    but, when you put that on E column, it only made the changes on E column. i want those changes on B column. so that is why i believe it has to be done with VBA. as far as i know formulas only valid for formulated cells.
    in example; vba code has to start by searching c2 within A:A, locate the matched cell on B column, replace founded cell with d2 and delete c2 and d2, continue by searching c3 within A:A, locate matched cell on B column, replace founded cell with d3 and delete c3 and d3 and so on...

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: find with vlookup and replace the value

    yes you are correct. i cannot change the contents of column B with a formula the way you want, sorry

  11. #11
    Registered User
    Join Date
    11-05-2012
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: find with vlookup and replace the value

    thanks anyway.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1