close

I have a table with dates in row 1 and city names in column A, plus
another worksheet which contains the data I want to use in the main
worksheet.

I can do a VLOOKUP on the place names in column A to return the correct
result by specifying the column number in the array; and I can do an
HLOOkUP on the dates in row 1 and return the correct result by
specifying the row number in that array.

How can I nest these and refer to both the date and the place name and
return the desired result?

Tuph in Melbourne, Australia--
tuph
------------------------------------------------------------------------
tuph's Profile: www.excelforum.com/member.php...oamp;userid=31390
View this thread: www.excelforum.com/showthread...hreadid=510876Once you know the row and column number, you can use indirect and address:
=indirect(address(4,5,,,quot;Sheet2quot;)), for instance, returns the value in
Sheet2!E4.
(You could also use the offset function: offset(Sheet2!$A$1,row-1,column-1)
--Brucequot;tuphquot; wrote:

gt;
gt; I have a table with dates in row 1 and city names in column A, plus
gt; another worksheet which contains the data I want to use in the main
gt; worksheet.
gt;
gt; I can do a VLOOKUP on the place names in column A to return the correct
gt; result by specifying the column number in the array; and I can do an
gt; HLOOkUP on the dates in row 1 and return the correct result by
gt; specifying the row number in that array.
gt;
gt; How can I nest these and refer to both the date and the place name and
gt; return the desired result?
gt;
gt; Tuph in Melbourne, Australia
gt;
gt;
gt; --
gt; tuph
gt; ------------------------------------------------------------------------
gt; tuph's Profile: www.excelforum.com/member.php...oamp;userid=31390
gt; View this thread: www.excelforum.com/showthread...hreadid=510876
gt;
gt;


Thanks, Bruce. I've been playing around with this, but can't make it
work. How does it match the place names and dates in both worksheets?--
tuph
------------------------------------------------------------------------
tuph's Profile: www.excelforum.com/member.php...oamp;userid=31390
View this thread: www.excelforum.com/showthread...hreadid=510876Are you trying to do a two-dimensional lookup?

www.j-walk.com/ss/excel/usertips/tip020.htm

You could also use the Match function for the third argument of Vlookup.
Match returns the index number of the match found, so you could use it to
match the date you're looking for to the dates in the first row of your table.

quot;tuphquot; wrote:

gt;
gt; I have a table with dates in row 1 and city names in column A, plus
gt; another worksheet which contains the data I want to use in the main
gt; worksheet.
gt;
gt; I can do a VLOOKUP on the place names in column A to return the correct
gt; result by specifying the column number in the array; and I can do an
gt; HLOOkUP on the dates in row 1 and return the correct result by
gt; specifying the row number in that array.
gt;
gt; How can I nest these and refer to both the date and the place name and
gt; return the desired result?
gt;
gt; Tuph in Melbourne, Australia
gt;
gt;
gt; --
gt; tuph
gt; ------------------------------------------------------------------------
gt; tuph's Profile: www.excelforum.com/member.php...oamp;userid=31390
gt; View this thread: www.excelforum.com/showthread...hreadid=510876
gt;
gt;

Try match: =match(quot;Melbournequot;,Sheet2!A:A,false) will tell you the row number
where Melbourne is first found in column A. Likewise
=match(date(2006,1,1),Sheet2!1:1,false) will tell you the first column
labeled 1/1/06. So those would be your row and column numbers.
In total:
=indirect(address(match(quot;Melbournequot;,Sheet2!A:A,fal se),match(date(2006,1,1),Sheet2!1:1,false),,,quot;Shee t2quot;))
--BP

quot;bpeltzerquot; wrote:

gt; Once you know the row and column number, you can use indirect and address:
gt; =indirect(address(4,5,,,quot;Sheet2quot;)), for instance, returns the value in
gt; Sheet2!E4.
gt; (You could also use the offset function: offset(Sheet2!$A$1,row-1,column-1)
gt; --Bruce
gt;
gt;
gt; quot;tuphquot; wrote:
gt;
gt; gt;
gt; gt; I have a table with dates in row 1 and city names in column A, plus
gt; gt; another worksheet which contains the data I want to use in the main
gt; gt; worksheet.
gt; gt;
gt; gt; I can do a VLOOKUP on the place names in column A to return the correct
gt; gt; result by specifying the column number in the array; and I can do an
gt; gt; HLOOkUP on the dates in row 1 and return the correct result by
gt; gt; specifying the row number in that array.
gt; gt;
gt; gt; How can I nest these and refer to both the date and the place name and
gt; gt; return the desired result?
gt; gt;
gt; gt; Tuph in Melbourne, Australia
gt; gt;
gt; gt;
gt; gt; --
gt; gt; tuph
gt; gt; ------------------------------------------------------------------------
gt; gt; tuph's Profile: www.excelforum.com/member.php...oamp;userid=31390
gt; gt; View this thread: www.excelforum.com/showthread...hreadid=510876
gt; gt;
gt; gt;


Thank you, soooo much. Your formula is exactly what I needed - up to a
point, of course!

In my summary worksheet I now have an INDIRECT formula which looks up a
location from col A and a date from row 5, and matches them with an
array in a separate data worksheet, returning the correct result. So
far, so good. BUT -

In looking more closely at the data tables, I find that I have several
arrays which contain the same date range, but only one column
containing the locations - column A. For example, I have data for each
month of the financial year for Sales, Budget, Staff Levels, etc. These
all run across the worksheet from left to right. Each array has it's
own column headings, which are specific to the data in the array, and
these headings are matched on the current month columns in the summary
worksheet.

My question is this: Can I have a 3-way lookup that addresses the
heading (picking up the array containing all columns with that
heading), the date, and the location? [Just in case you have nothing
else to do )]--
tuph
------------------------------------------------------------------------
tuph's Profile: www.excelforum.com/member.php...oamp;userid=31390
View this thread: www.excelforum.com/showthread...hreadid=510876

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()