0

I'm fairly new to Excel so excuse my noobish question. I am working on a roster spreadsheet and have a bunch of shop codes, essentially abbreviations of the shop name in a column, and I have been asked to replace them with the shop name. Is there some kind of script or code I can use to replace the abbreviation with the name? This will also be a template file that we constantly copy and paste information into, so it needs to be able to change if members from certain shops no longer appear on the spreadsheet. The software we use to generate the information for the spreadsheet is quite outdated and it is well beyond my knowledge to update it.

An example of what I'm asking is, in column C I have all of the shop codes (TRS, FFS, SMG, etc...), I just need something that would automatically swap those out to the actual full shop name once data is copied into that column. Is that possible?

2
  • directly overwriting data in a column requires Visual Basic for Applications (VBA) or Office Scripts (if only using web based excel). The typical solution is to have separate "data" and "reporting" tabs. The reporting tab would have formulas that would then substitute the desired format.
    – gns100
    Commented Jul 28, 2023 at 15:31
  • I just thought of this, you might be able to use data validation to help do what you want.
    – gns100
    Commented Jul 28, 2023 at 15:34

1 Answer 1

1

Replace content of a cell: no, but...

=VLOOKUP(...)

Looks up the first parameter in the first column of a list, then allows to pick up and return any of the columns in the same row of the list.

So;

  1. given a string of text in e.g. A1,
  2. it will find that string (exact match or not) in column X of X1:Z999
    (which needs to be sorted on column X)
  3. and from the same row (where it found it), pick out the item in column two (Y).

This when given A1 (reading it's content), 'X1:Z999', '2' and False (for "Exact" matching) as arguments. => =VLOOKUP(A1,X1:Z999,2,False)

Tip: Right click (the header) and Hide the column you don not wish to see/show.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .