Thursday, July 16, 2020

Using VLOOKUP for Idiots (Add Code Name Column, Given Data With Code Number Column)

Let's say you have have 2018 data for payments for 81501, 81502, etc.

A           B
81501   $221,000
81502   $250,000  etc

You want to insert the correct short code name between the code and the payments.

In B1 and below, place a new column:

VLOOKUP(A1, $F$1:$G:$4, 2)

This points to an array at the right which is two columns wide and four rows deep and gives the Code name for each code.  For example, 81502 = CYP1.   The dollar column became column C.


See also table at far bottom.


ADVANCED LESSON - (EXTRA PAGE)

Let's say the code text data is on a separate page.   (For example, Page 1 is the UTILIZATION file by code and Page 2 is the Annual CLFS file with code, name, and price.)

The convention for getting the array from a different page:

$F$1:$G$4 becomes

PAGE2!$F$1:$G$4


I believe if the page number has spaces the full name goes in single quotes.



___
See a later article by me on this topic here.  A set of related Excel functions are VLOOKUP, INDEX, and MATCH and give you some options although the method above will work well enough.

___
zexcel

click to enlarge





No comments:

Post a Comment

Note: Only a member of this blog may post a comment.