Dynamic Lookups

Published on December 2016 | Categories: Documents | Downloads: 28 | Comments: 0 | Views: 223
of 5
Download PDF   Embed   Report

Comments

Content

Excel Dynamic Lookup Formulas. Locating the Correct Excel Column

Page 1 of 5

HOME | SEARCH | PRODUCTS | CONTACT | DEVELOPMENT FREE: EXCEL FORMULAS > MACROS > EXCEL HELP > DOWNLOADS

SPECIAL!

EXCEL DYNAMIC LOOKUP FORMULAS

www dotnetcharting com

Feedback - Ads by Google

LOCATING THE CORRECT EXCEL COLUMN
Current Special! Complete Excel EXCEL TRAINING COURSE for Excel 97 - Excel 2003, only $145.00. $59.95 Instant BUY/DOWNLOAD, 30 Day Money Back
Guarantee & Free EXCEL HELP for LIFE!

Search
Dynamic Lookups in Excel You can DOWNLOAD A WORKING SAMPLE FROM THE HERE These are very handy for when you lookup data but cannot be sure which column your returned data should come from. In other words, users may have inserted a column within the table. The VLOOKUP is about the most popular of the Lookup functions so we will use this function for examples.

Ok, let's go with a sample using a small table of data for ease of understanding. You can DOWNLOAD A WORKING SAMPLE FROM THE HERE The layout of our data are headings in row 1 from A1:D1 on a Worksheet called "Data". Names | Department | Age | Gender | Pay Rate P/H

http://www.ozgrid.com/Excel/dynamic-lookups.htm

3/6/2007

Excel Dynamic Lookup Formulas. Locating the Correct Excel Column

Page 2 of 5

Directly underneath these headings is related data. For simplicity though, only down to row 8.

CREATE NAMED DYNAMIC RANGES Or here for all types of NAMED RANGES .

NAMING THE NEEDED RANGES *You can, if you wish, use many more rows than A1:A19,B1:B19 etc to ensure your dynamic named ranges will keep expanding*

1) While on the "Data" Worksheet Go to Insert>Name>Define.

2) In the "Names in Workbook:" box type: Data_Table.

3) In the "Refers to:" box type, or copy/paste; =OFFSET(Data!$A$1,0,0,COUNTA(Data!$A$1:$A$19),COUNTA(Data!$1:$1))

4) Click Add but not OK, just yet.

5) Repeat steps 2, 3 and 4 using the names (no quotes) and formulas below. "Names" =OFFSET(Data!$A$1,0,0,COUNTA(Data!$A$1:$A$19),1)

"Department" =OFFSET(Data!$B$1,0,0,COUNTA(Data!$B$1:$B$19),1)

"Age" =OFFSET(Data!$C$1,0,0,COUNTA(Data!$C$1:$C$19),1)

"Gender"

http://www.ozgrid.com/Excel/dynamic-lookups.htm

3/6/2007

Excel Dynamic Lookup Formulas. Locating the Correct Excel Column

Page 3 of 5

=OFFSET(Data!$D$1,0,0,COUNTA(Data!$D$1:$D$19),1)

"Pay_Rate_PH" =OFFSET(Data!$E$1,0,0,COUNTA(Data!$E$1:$E$19),1)

"Headings" =OFFSET(Data!$A$1,0,0,1,COUNTA(Data!$1:$1))

6) Now after clicking Add for the last named range, click OK.

It is vital that there is no other data on the "Data" Worksheet other than your table of data occupying A1:E8.

Let's now show some formulas that can be used to lookup a name in the table (Data_Table) and return the "Department" they work in.

VLOOKUP WITH COLUMN() =VLOOKUP("June K",Data_Table,COLUMN(Department),FALSE)

This formula will locate the name "June K" in the 1st column of data (Names) and return the corresponding row from the "Department" column. Should a user insert a column anywhere within, or at the end of the table, the formula will still return the correct result. However, should a column be added before Column A (making "Names" become column B) it will fail. To address this potential problem we could use INDEX WITH MATCH .

INDEX WITH MATCH =INDEX(Data_Table,MATCH("June K",Names,0),MATCH("Department",Headings,0))

This formula is the most flexible as not only will it accommodate columns being added anywhere within, before or after the table, we can also use it to look left of our Names column. This may be needed when/if a column is added to the Start of our table.

http://www.ozgrid.com/Excel/dynamic-lookups.htm

3/6/2007

Excel Dynamic Lookup Formulas. Locating the Correct Excel Column

Page 4 of 5

VLOOKUP WITH MATCH =VLOOKUP("June K",Data_Table,MATCH("Department",Headings,0))

Again though, as it uses VLOOKUP it will always look in the first column only of the table (Data_Table) for the name.

INTERSECTION =June_K Department

This last one requires us to add some more named ranges, but we can do so with the aid of Excel.

1) Select the table of data but do not include any headings.

2) Go to Insert>Name>Create and ensure that ONLY "Left column" is checked and click OK.

Ok, we have now created a named range for all our names. It should be noted that, as spaces are not allowed, Excel would replace any spaces with the underscore. That is "June K" would be named "June_K".

Now we can simply Enter the Intersection formula as shown below into any cell and it will return the Department (or any other column) of the persons name we use. In this case it's "June K". It is vital to note that there IS a space between "June_K" and "Department"

=June_K Department Back to EXCEL FORMULAS Tips tricks etc EXCEL DASHBOARD REPORTS & EXCEL DASHBOARD CHARTS 50% Off Special! Free Choice of COMPLETE EXCEL TRAINING COURSE OR EXCEL ADD-INS COLLECTION on all purchases totaling over $64.00. ALL PURCHASES totaling over

http://www.ozgrid.com/Excel/dynamic-lookups.htm

3/6/2007

Excel Dynamic Lookup Formulas. Locating the Correct Excel Column

Page 5 of 5

$150.00 gets you BOTH! Purchases MUST be made via this site. Send payment proof to [email protected] 31 days after purchase date.

Beyond Spreadsheets
Quantrix: Used by Top Financial Modelers in More Than 40 Countries. www.Quantrix.com
Ads by Google - Advertise on this site

Instant Download and Money Back Guarantee on Most Software

Search

or browse SOFTWARE CATEGORIES

EXCEL TRADER PACKAGE Technical Analysis in Excel With $139.00 of FREE software!

FREE DOWNLOAD!
Microsoft ® and Microsoft Excel ® are registered trademarks of Microsoft Corporation. OzGrid is in no way associated with Microsoft

FREE EXCEL HELP

www.excel4apps.com

Feedback - Ads by Google

http://www.ozgrid.com/Excel/dynamic-lookups.htm

3/6/2007

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close