Excel Offset function

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hi,
if I want to use Offset but want to do this based on a value , so I want the cell reference containing X as my starting point,
I have tried ;

Excel Formula:
  CELL("address",INDEX($A$1:$A$13,MATCH(D1,$A$1:$A$13,0),1) )[ = $A$4

Which returns the correct cell reference but when I nest in Offset I get an error, so I'm either making a basic mistake or
I need a deferent approach?

Richard.
 
Your descriptions are not really communicating what you need. It might be straightforward in your own head but it is not coming across to us. Consider using XL2BB to show a worksheet range.

Looking at your example formula, which seems to be totally different than your first post:
Excel Formula:
MATCH("c",H7:H14,0)  - 2
So you are looking for the value "c" in the range H7:H14. You want to return the value that is 2 rows above that. You do this:
Excel Formula:
=INDEX(H5:H12,MATCH("c",H7:H14,0))

This assumes that 2 (for 2 rows above) is constant, not a variable in a cell. This could also be done with OFFSET, but I'm avoiding that for a simple case like this.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
6StringJazzer,

Like you, it is not quite clear to me and conditions seem to be shifting (a realistic example like we both asked for would be most helpful).
However, if you look at the formula they posted in reply 10, the OFFSET function is returning a multi-cell range (3 rows by 2 columns).
So that may be one reason why INDEX/MATCH won't work, if they are looking to return a 3x2 grid, and not a single cell.
 
Upvote 0
Having had the benefit of the previous discussion I am wondering if it is worth zooming in on what you said works and seeing if that takes us anywhere.
Ignoring looking in multiple columns to find the address which might be worth a separate thread, in post #1 you said your index match returned the correct address and in post #10 you gave an example of an offset function you wanted to use.
Using the fact that INDEX and XLOOKUP return the actual Cell and not just the value in the cell, combining your post 1 & 10 info would give you this:

PS: I had to move the lookup value D1 in post 1 out of the return value range post 10, so it is in J1.

INDEX
Excel Formula:
=OFFSET(INDEX($A$1:$A$13,MATCH(D1,$A$1:$A$13,0),1),4,2,3,2)

XLOOKUP
Excel Formula:
=OFFSET(XLOOKUP(J1,$A$1:$A$13,$A$1:$A$13),4,2,3,2)


Book1
ABCDEFGHIJ
1112131415161Search Value --->13
2122232425262
3132333435363INDEX
4142434445464=OFFSET(INDEX($A$1:$A$13,MATCH(J1,$A$1:$A$13,0),1),4,2,3,2)
5152535455565
61626364656663747
71727374757673848
81828384858683949
9192939495969
10203040506070
11213141516171XLOOKUP
12=OFFSET(XLOOKUP(J1,$A$1:$A$13,$A$1:$A$13),4,2,3,2)
13
143747
153848
163949
Sheet1
Cell Formulas
RangeFormula
H4,H12H4=FORMULATEXT(H6)
H6:I8H6=OFFSET(INDEX($A$1:$A$13,MATCH(J1,$A$1:$A$13,0),1),4,2,3,2)
H14:I16H14=OFFSET(XLOOKUP(J1,$A$1:$A$13,$A$1:$A$13),4,2,3,2)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,712
Members
452,995
Latest member
isldboy

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