Using CELL to get the address of an INDEX, then using SUM OFFSET

KansaiDorifto

New Member
Joined
Nov 16, 2021
Messages
9
Office Version
  1. 2010
Platform
  1. Windows
Hello

I have a number (e.g. $5,000) which I want to look up in a table, then I want to add it and the next two numbers next to it.

I have tried:
1) Using INDEX/MATCH to get the number
+INDEX($M$3:$AK$21, MATCH($M45, $M$3:$M$21, 0), MATCH(N$43, $M$3:$AK$3, 0)) -> which results in a number $5000
2) Using CELL/ADDRESS to get the cell location of that result
=CELL("address", INDEX($M$3:$AK$21, MATCH($M45, $M$3:$M$21, 0), MATCH(N$43, $M$3:$AK$3, 0)) ) -> which results in $N$8
3) But when I include it in a SUM/OFFSET formula, it generates an error:
+SUM(OFFSET(CELL("address", INDEX($M$3:$AK$21, MATCH($M45, $M$3:$M$21, 0), MATCH(N$43, $M$3:$AK$3, 0)) ), 0, 0, 1, 3)) -> error

I don't understand why it's causing an error, because it works when I manually type in $N$8:
+SUM(OFFSET($N$8, 0, 0, 1, 3))
and my step 2 should be returning exactly $N$8?

Appreciate any help on solving this, or a better formula to get this done.

Thanks!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Have you tried confirm with Ctrl-Shift-Enter, instead of Enter?
BTW, I believe there is other solution. Your solution is full of volatile functions those need to avoid using.
Share the sheet to get better solution, without volatile formula.
 
Upvote 0
Have you tried confirm with Ctrl-Shift-Enter, instead of Enter?
BTW, I believe there is other solution. Your solution is full of volatile functions those need to avoid using.
Share the sheet to get better solution, without volatile formula.
Hi bebo

Yes i have tried it, same error.

Unfortunately I cannot install the xl2bb tp upload the mini sheet since this is my work laptop. Here is an image of what i'm trying to do:
 

Attachments

  • excel.png
    excel.png
    16.3 KB · Views: 6
Upvote 0
CELL function returns cell address, but in text string, not reference.
try put it inside INDIRECT() then it should works

Book1
GHIJKL
2Output
3241
4
5aabbccddee
6a3842561342
7b10059718585
8c1311126196
9d7377832111
10e1762622260
11f2583244449
12g9068174542
Sheet1
Cell Formulas
RangeFormula
L3L3=SUM(OFFSET(INDIRECT(CELL("address",INDEX($G$5:$L$12, MATCH("b", $G$5:$G$12, 0),MATCH("cc", $G$5:$L$5, 0)))),0,0,1,3))
 
Upvote 0
With one more option (shorter) in Output2
Book1
GHIJKLM
1
2Output1Output2
3241241
4
5aabbccddee
6a3842561342
7b10059718585
8c1311126196
9d7377832111
10e1762622260
11f2583244449
12g9068174542
Sheet1
Cell Formulas
RangeFormula
L3L3=SUM(OFFSET(INDIRECT(CELL("address",INDEX($G$5:$L$12, MATCH("b", $G$5:$G$12, 0),MATCH("cc", $G$5:$L$5, 0)))),0,0,1,3))
M3M3=SUM(OFFSET(G5,MATCH("b",$G$6:$G$12,0),MATCH("cc",$H$5:$L$5,0),,3))
 
Upvote 0
Solution
With one more option (shorter) in Output2
Book1
GHIJKLM
1
2Output1Output2
3241241
4
5aabbccddee
6a3842561342
7b10059718585
8c1311126196
9d7377832111
10e1762622260
11f2583244449
12g9068174542
Sheet1
Cell Formulas
RangeFormula
L3L3=SUM(OFFSET(INDIRECT(CELL("address",INDEX($G$5:$L$12, MATCH("b", $G$5:$G$12, 0),MATCH("cc", $G$5:$L$5, 0)))),0,0,1,3))
M3M3=SUM(OFFSET(G5,MATCH("b",$G$6:$G$12,0),MATCH("cc",$H$5:$L$5,0),,3))
Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,048
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top