Lookup and Calculate Formula
In a separate question I looked for the the formula I received below (and it
works great). here is that question:
I have columns 5-16 (E:P) filled with monthly data.
Column 5 (E) contains May, column 6 (F) June, etc.
In Cell A1 I have the current month (7 for July, 8 for Aug, etc.).
I want to sum cells E5 through ?5 based on the number in cell A1.
For July the sum would be E5:G5, for August it would be E5:H5, etc.)
What fomula would I use to create the sum based on the data in cell A1?
But I can't seem to get to what I really want which is a lookup that returns
the offset formula.
Full story: I have a sheet (YTD) that totals year to date budget numbers by
employee. I have another sheet (Budget) that has the budget numbers for each
month by employee. Then I have an additional column for each month that
totals year to date (our year is May-April), so I have a May-Jun column,
May-Jul, May-Aug, May-Sep.
In A1 of the Budget sheet I manually place the column number of the current
month. (July happens to be 7). In Cell A2 I place the column number of the
YTD column that I want for the month (May-Jul is column 18).
This lookup gives me the total ytd: VLOOKUP($A10,Budget,Budget!$A$2,FALSE)
(It looks up the employee in A10, goes to the Budget range, and returns the
column number from A2).
I was trying to avoid having a separate column for each YTD total and the
OFFSET accomplished that nicely, but I can't seem to make it work with the
lookup.
"T. Valko" wrote:
=SUM(OFFSET(E13,0,0,1,A1-4))
What's in A1?
--
Biff
Microsoft Excel MVP
"Karin" wrote in message
...
Oops - I wrote the Offset wrong, s/b =SUM(OFFSET(E13,0,0,1,A1-4))
I can't seem to get match or index to work.
"Karin" wrote:
In another post I got an Offset answer, but what I ultimately want to do
and
can't seem to get to is:
On Sheet YTD, look up Cell A10 (Smith) in the range "Budget", (Smith is
found in cell A13 in the range), then calculate this offset for the Row
A13
in the range "Budget"
=SUM(OFFSET(A13,0,0,1,A1-4))
And change the row number based on the look up.
TIA!
|