Reputation: 13
I have two sheets within a workbook, the first with several thousand lines of expenses, separated by individuals, and the second a summary of totals and such.
On the second sheet, I've created a reference to the first to insert each individual's name (i.e. B4: ='Card Transactions'!D89). I'm having difficulty with the syntax for returning the total of each individual's total, which is in a predictable cell in the first sheet relative to the name (down 1, right 7).
I've tried the following: =offset(indirect(B4),1,7) with only a reference error in return. This seems like it should be relatively simple but I'm not having any luck. . . any suggestions?
Upvotes: 1
Views: 782
Reputation: 1644
The following should work for you as long as your data follows these rules:
Let's say your first sheet is set out like this:
And you want your second sheet like this:
And your sheets are named:
This is the formula in B2 of Sheet2:
=INDEX(Sheet1!$A$1:$H$9,MATCH(A1,Sheet1!$A$1:$A$9,0)+1,MATCH("Column 8",Sheet1!$A$1:$H$1,0))
And here's what it does:
$A$1:$H$9
and the $
signs mean the range won't move when you drag down the formula, so they are important!$A$1:$A$9
and the row numbers must match the row numbers in the index array. The match has a "+1" at the end, so it will find the matching row, then add one row down to get your offset.$A$1:$H$1
and the column letters must match the column letters in the index array.Let me know if this doesn't fit your problem, I'm sure we can figure it out.
Thanks.
Upvotes: 0
Reputation: 152505
use this:
=OFFSET(INDIRECT(MID(FORMULATEXT(B4),2,300)),1,7)
note:
Upvotes: 2