Trying to refer to a dynamic cell within a fornmula

sinasdf

New Member
Joined
Dec 4, 2017
Messages
37
Hi guys,

I have the following formula:
=SUM(OFFSET(B2,0,0,1,-4))

This formula returns the summed value of all 3 columns to the left of B2 as well as B2.

I'm having an issue whenever I want to change the reference to something else dynamically rather than hardcoding it. So instead of B2, it could be CA99, X15, e.t.c. This cell reference changes based on a location of a certain unique number, so it changes frequently.

Is there any way to do this?

I'm thinking that I have to designate another cell (lets say A1) that will contain the dynamic cell reference.

I've been playing around with CELL and INDIRECT but I can't get anything to work.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hello,

all 3 columns to the left of B2
...

What are the 3 Columns to the Left of B2 ...???

Just to confirm ... you can use indirect()

=SUM(OFFSET(INDIRECT(X15),5,0,1,4))

HTH
 
Last edited:
Upvote 0
Hello,

...

What are the 3 Columns to the Left of B2 ...???

Just to confirm ... you can use indirect()

=SUM(OFFSET(INDIRECT(X15),5,0,1,4))

HTH

Sorry, that was a bad example. Lets use your example...

In regards to the cell reference of X15, what if instead of X15, I want another cell? It's going to be dynamic and changing based on my input. For example, I may have 5 dates, and if put a marker of "x" in a cell, I want that cell to be returned. So it could be X15, Y15, e.t.c.

Shall we use cell X15 to contain that dynamic cell reference?
 
Upvote 0
Well ...

Thanks to the Indirect() function ...

in your cell X15 ... you can type B4 or C12 ...

HTH
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,409
Members
448,959
Latest member
camelliaCase

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