Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

2 Questions Involving Lookups for An Array in a different workbook

Posted on 2014-10-10
Medium Priority
132 Views
Hello,

I am working with multiples trying to automate an end of a month progress.  And a couple questions have arisen that I can't seem to solve.

This formula works to pull the appropriate value
=VLOOKUP(VLOOKUP(\$A:\$A,'Key to 13 Month'!\$A:\$B,2,FALSE),'Q:\1 - Financial Reporting\2014\08 - 2014 Experiment\PL Prelims\[13 MO Adj EBITDA.xls]Hawaii'!\$A\$1:\$N\$65536,14,FALSE)

And this formula works.
{=SUM(VLOOKUP("Storage - Hard Copy",'Q:\1 - Financial Reporting\2014\08 - 2014 Experiment\PL Prelims\[13 MO Adj EBITDA.xls]Hawaii'!\$A\$1:\$N\$65536,{7,8,9,10,11,12,13,14},FALSE))}

1)However, I can't seem to turn that second formula into a Vlookup from a hard code.  Is it possible or does it require hard coding?

2)Is there a way to turn the array into a cell reference? {7,8,9,10,11,12,13,14} I've tried with no success.
0
Question by:mattfmiller
• 3
• 2
• 2
• +1

LVL 19

Assisted Solution

Richard Daneke earned 500 total points
ID: 40373364
Your second formula is an array formula.   This means that an area of your worksheet is performing the calculation.  To set an array formula, one uses Control-Shift-Enter when finished entering the formula in place of the simpler Enter key.
The array in cell reference is to provide the 8 columns that you want to return across the columns where the Vlookup is set.  The array formula can be replaced with a standard vlookup, but the replacement formula will be different for each of the 8 columns where it is in place.
0

LVL 27

Assisted Solution

ProfessorJimJam earned 500 total points
ID: 40373366
put in a column like this for example  from A1 to A8 and then instead of

{=SUM(VLOOKUP("Storage - Hard Copy",'Q:\1 - Financial Reporting\2014\08 - 2014 Experiment\PL Prelims\[13 MO Adj EBITDA.xls]Hawaii'!\$A\$1:\$N\$65536,{7,8,9,10,11,12,13,14},FALSE))}

put {=SUM(VLOOKUP("Storage - Hard Copy",'Q:\1 - Financial Reporting\2014\08 - 2014 Experiment\PL Prelims\[13 MO Adj EBITDA.xls]Hawaii'!\$A\$1:\$N\$65536,A1:A8,FALSE))}

7
8
9
10
11
12
13
14
0

LVL 1

Author Comment

ID: 40373394
The problem for the second solution, is that I have a different number of columns depending on an input.

The array works if I have the same number of variables but breaks if I have less or more.  Is there a way can I can reference a particular cell to do that?

0

LVL 27

Expert Comment

ID: 40373513
in that case, that may need the dynamic range.

are you familiar of creating dynamic expandable range?
0

LVL 27

Accepted Solution

Glenn Ray earned 1000 total points
ID: 40373541
Since you are trying to sum up the values in columns G:N (7-14) where the value in column A is  "Storage - Hard Copy", then you need an array in that third argument to allow this to happen.  And, the formula needs to be an array formula (enter with [Ctrl]+[Shift]+[Enter], curly brackets not shown):

=SUM(VLOOKUP("Storage - Hard Copy",'Q:\1 - Financial Reporting\2014\08 - 2014 Experiment\PL Prelims\[13 MO Adj EBITDA.xls]Hawaii'!\$A\$1:\$N\$65536,Column(G:N),FALSE))

If the number/position of columns varies, then you could replace the third argument with a dynamic range name.  But we'll need more information on how that's determined.

Regards,
-Glenn
0

LVL 1

Author Comment

ID: 40373578
I am not familiar with dynamic expandable ranges.

Glenn, I think your column G:N thing might be the solution I'm looking for.  Is there a way to turn that G:N into referencing a cell value?  I'm experimenting with it with no luck so far.
0

LVL 27

Assisted Solution

Glenn Ray earned 1000 total points
ID: 40373606
You could use the INDIRECT function. If you had a cell with the text that specified the columns to look in, for example:
A1: "G:N"  (text value here, no quotes actually used)

you could replace the COLUMN portion in the above formula with
COLUMN(INDIRECT(A1))

and that would work the same.

So, if there is some trigger that determines the starting column and ending column, you could have that create the value in the "master cell" (A1, in this example) and the formulas would work.

My gut tells me this is not the best solution. :-/    If your criteria for the columns is numeric (say columns 7-10 in one instance, or 7-12 in another) then you could use the ROW function instead - it would be more direct.

-Glenn
0

LVL 1

Author Comment

ID: 40373629
Thank you very much.  That's exactly what I was looking for.
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calculâ€¦