Offset cell addresses

ChristineJ

Well-known Member
Joined
May 18, 2009
Messages
773
Office Version
  1. 365
Platform
  1. Windows
Cell T31 = E9, X5, A1

I am using the following formula in cell U31 to add two column letters and one row to each cell reference in T31:

Code:
=IF(T31="","",SUBSTITUTE(TEXTJOIN(", ",1,@CELL("address",OFFSET(INDIRECT(TRIM(MID(SUBSTITUTE(T31,", ",REPT(" ",LEN(T31))),@SEQUENCE(LEN(T31)-LEN(SUBSTITUTE(T31,",",""))+1,,0,LEN(T31))+1,LEN(T31)))),1,2))),"$",""))

It returns G10 in cell U31 - it only works for the first cell address, E9.

Can this be adjusted so that it returns G10, Z6, C2 in cell U31 --- offsetting all three cell addresses? Thanks
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
How about:

Book1
TU
31E9, X5, A1G10, Z6, C2
Sheet1
Cell Formulas
RangeFormula
U31U31=IF(T31="","",LET(ad,TRIM(MID(SUBSTITUTE(T31,",",REPT(" ",99)),SEQUENCE(LEN(T31)-LEN(SUBSTITUTE(T31,",",""))+1,,,99),99)),TEXTJOIN(", ",1,ADDRESS(ROW(INDIRECT(ad))+1,COLUMN(INDIRECT(ad))+2,4))))
 
Upvote 0
You could use the vba that you asked for earlier as a function to make the formula much simpler.
VBA Code:
Function MCELL(r As Long, c As Long, rng As String) As String
MCELL = Range(rng).Offset(r, c).Address(0, 0)
End Function
Book1
TU
31E9, X5, A1G10,Z6,C2
Sheet4
Cell Formulas
RangeFormula
U31U31=mcell(1,2,T31)
 
Upvote 0
How about:

Book1
TU
31E9, X5, A1G10, Z6, C2
Sheet1
Cell Formulas
RangeFormula
U31U31=IF(T31="","",LET(ad,TRIM(MID(SUBSTITUTE(T31,",",REPT(" ",99)),SEQUENCE(LEN(T31)-LEN(SUBSTITUTE(T31,",",""))+1,,,99),99)),TEXTJOIN(", ",1,ADDRESS(ROW(INDIRECT(ad))+1,COLUMN(INDIRECT(ad))+2,4))))
Yes, thank you! CJ
 
Upvote 0
You could use the vba that you asked for earlier as a function to make the formula much simpler.
VBA Code:
Function MCELL(r As Long, c As Long, rng As String) As String
MCELL = Range(rng).Offset(r, c).Address(0, 0)
End Function
Book1
TU
31E9, X5, A1G10,Z6,C2
Sheet4
Cell Formulas
RangeFormula
U31U31=mcell(1,2,T31)
Brilliant! Thank you. I did not even realize I was asking the same thing in a different way. Appreciate your help on this.
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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