0

I have a sheet with a table, with two columns. In the first column is a number of the compartment, and in the second the name of the compartment.

ID    NAME
121   Fore peak
224   Enterance (s)
.
.
etc.

Since those tables were composed in short time the names were sometimes written in full, sometimes with acronyms and sometimes just with some hope someone will figure them out from the ingeniosity that they are now.

Is there a way to make a sheet-wise replacement, of the name depending on the number in the cell to the left?

IF any_cell = 121 cell_to_the_right_of_it = 'Fore peak'

Something like that?

wonea
  • 1,877
Rook
  • 24,289

1 Answers1

0

Leading on from your pseudo code, in the B Column

=IF(A1 = 100, "Name of Item", "")

I would suspect though this isn't a realistic solution, especially if you lots of ID's. So if you already know what name is associated with what ID then in another sheet on Excel I'd be tempted to write out the mapping.

EG, Assume the data you have so far is on worksheet1 then on worksheet2 write out something like

ID       Name
1    CompartmentThis
2    CompartmentThat
5    CompartmentOther
115  ComparementMore
121  Fore peak
224  Entrenance (s)

Then, my formula on worksheet1, in Column B (overwriting the Name) would look up the matching value with code similar too

=LOOKUP(A1, Sheet2!A:A, Sheet2!B:B)

Drag this formula all the way down your B column on worksheet1 and it will do all the hard work for you (assuming that ID really is unique)!

Dave
  • 25,513