View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default offset a lookup in excel

If your table begins in A1, then this ought to do it:
=sum(offset($A$1, match("b",$A:$A,false)-1,match("This
week",$1:$1,false)-2,1,2))
(Change A and 1 as needed to meet your needs; you could also change "b" to
refer to a cell containing the account of interest).
In words, it says to find "b" in column A and move down that many rows, less
1, from $A$1. Then find "This week" in row 1 and move over that many
columns, less 2. Add the values of in the rectangle one row high and two
columns wide from that starting point.
HTH. --Bruce

"Inni17" wrote:

I want to lookup a moving range in a table.

account week 1 week2 week 3 This week week 5
a 1 2 3 4 5
b 1 3 4 5 6
c 2 3 3 5 5
d 2 2 5 3 2

So I want to use a looukp to say the sales for account b this week and last
week were 9 units. I will only update the this week columm so I want my
formlua to search for "this week" and return the value for the sum of "this
week" and "this week" -1.