Offset + Indirect / Index + Match

drag1c

Board Regular
Joined
Aug 7, 2019
Messages
97
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Dear Mr.Excel,

I am struggling with OFFSET function when source row is deleted.
Here below is basic example:
1) Sheet2.Range("A2:R50") is my table with data
2) Sheet1.Range("A5:R20") is my table with offset data + scrollbar.

If I remove any row in table 1), I automatically get #REF in Offset formula.
I've heard it could be possible to use Offset + Indirect in combination to avoid that problem so Offset can be referenced on cell address instead of data in cell.

Right now I use formula:
Code:
=IF(OFFSET(Database_Copy!A1,$A$6,0)="","",OFFSET(Database_Copy!A1,$A$6,0))

But I would like to switch it to OFFSET + Indirect (or Index(Match*)

Could you help me make such a formula?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What is in the source, is it numeric data or text?

It could be as simple as
Excel Formula:
=T(INDEX(Database_Copy!A:A,ROWS(A$1:A1)+$A$6))

Note that the ROWS() part of the formula should refer to the cell that you enter the formula into (the first one before filling down) so if you enter it into F6 then you would change that part to F$6:F6 (this is done to prevent further errors if you delete rows on the formula sheet).
 
Upvote 0
Solution
@jasonb75 table is with text, number and dates. When I have numbers or dates, this formula does not work. I've tried to remove "T function" but then it's chaotic.

So, it's a mix.

edit: It seems I've found solution like this:
Code:
=IF(IF(T(INDEX(Database_Copy!A:A,ROWS(B$6:B6)+$A$6))="",N(INDEX(Database_Copy!A:A,ROWS(B$6:B6)+$A$6)),T(INDEX(Database_Copy!A:A,ROWS(B$6:B6)+$A$6)))=0,"",IF(T(INDEX(Database_Copy!A:A,ROWS(B$6:B6)+$A$6))="",N(INDEX(Database_Copy!A:A,ROWS(B$6:B6)+$A$6)),T(INDEX(Database_Copy!A:A,ROWS(B$6:B6)+$A$6))))

This formula removes zeroes + it allows entering numbers and text in the same time.

Thank you very much @jasonb75 !
 
Last edited:
Upvote 0
@jasonb75 to not open new topic, since it's addition:
If I would like to use your formula to show only filtered rows, how should I edit it?
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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