excelopenoffice-calclibreoffice-calcgnumeric

Conditionally show a value from a row that has a cell in it with a matching value


I am trying to find an Excel (or LibreOffice or Gnumeric) formula that would make a cell show the value from column B using some row which is determined by the value in the cell next to the formula-based cell. For example, if the cell next to the formula was "name03", the formula should be replaced with "0.83".

It would be even better if instead of using Column A, it found that the correct Column was A, using the column name, eg. Column with label "Names".

I am not looking for VBA or macros, just standard spreadsheet equations.

Column A    B       C       D   

Names,  Scores, Date,   Comments
name01, 0.95,   20141105,   "NA"
name02, 0.92,   20141105,   "NA"
name03, 0.83,   20141105,   "NA"
name04, 0.81,   20141105,   "NA"
name05, 0.70,   20141105,   "NA"
name06, 0.70,   20141105,   "NA"

elsewhere (probably in a different sheet):

name03, =WHAT_FORMULA??

Solution

  • Assuming your data is in sheet2, and your formula is in cell B2 of sheet2, use this

    =vlookup(A2,sheet1!$A$2:$D$10,2,0)