Copy value to another sheet based on criteria

Otk168 Posted messages 3 Status Member -  
via55 Posted messages 14393 Registration date   Status Member Last intervention   -
Hello everyone,

I am a beginner in Excel, trying to learn gradually both simple and complex formulas.
My problem is as follows:
My workbook consists of 2 sheets, the first contains a "database" with 2 columns (the first gives a reference and the second an associated code for that reference)
In the second sheet, there is a set of rows with a column containing the reference (from the first sheet).
I would like a formula that can fetch the associated code for each reference from page 1 and report it on page 2.
I hope I have been clear and explicit about this problem.

Thank you in advance for your help.

1 answer

  1. via55 Posted messages 14393 Registration date   Status Member Last intervention   2 759
     
    Hello

    You must use VLOOKUP

    =VLOOKUP(A1,Sheet1!A:B,2,0)

    A1 being the value to look for
    Sheet1!A:B the table where to search
    2 the column of the information to return
    0 requires an exact match

    Best regards
    Via

    --
    "Imagination is more important than knowledge." A. Einstein
    0
    1. Otk168 Posted messages 3 Status Member
       
      Thank you very much, I tried it and it works wonderfully.
      0
    2. Otk168 Posted messages 3 Status Member
       
      Sorry, I'm going to be a bit annoying, but does this formula work to return entire rows?
      0
      1. via55 Posted messages 14393 Registration date   Status Member Last intervention   2 759 > Otk168 Posted messages 3 Status Member
         
        Re,

        To return multiple columns, you enlarge the original table
        Sheet1!A:D to return the values from columns B to D, for example
        Then you change the column number to return in the formula in the destination columns, 2 to return the value from column B, 3 for column C, etc.
        0