INDEX Function with Dynamic Array

UnitedCloud01

New Member
Joined
Nov 14, 2017
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone

I have an array in my spreadsheet where I need to add rows periodically.

I have the following array with fixed parameters that I then update and have to copy down the column to the end of the new rows each time I add a series of new rows. I would like to have a more dynamic formula the negates this step. Currently the rows total 2100.

{=IFERROR(INDEX($C:$C,SMALL(IF($S$5:$S$2100<>"",IF($L$5:$L$2100="",IF($C$5:$C$2100<>"",ROW($S$5:$S$2100)))),ROWS(V$5:V5))),"")}

Column 'C' contains patients name that I add to a list. Column 'S' contains data that captures if this patient is overdue for a risk review. Column 'L' ensures the patient is open and not closed. Column 'V' then captures all patient names due for a risk review. A macro then pulls from this column and populates a cell where the patient names are all collated.

Many thanks for your assistance.

Chat soon

Scott
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
2100 can be changed to 10000, expecting total rows does not exceed 10000.
Oh wow, so it really is that simple. I did see some suggestions online but was doubting myself. Thanks so much. Just checking, that won't impact the processing speed, will it?
 
Upvote 0
Another possibility is to use an Excel table. Then your formulae will automatically adjust down the columns if you add new rows.

Book3
ABCDEFGHIJKLMNOPQRSTUVW
1
2
3
4Name23456789Col L111213141516Due?1819Names due
5Ax1A
6BxB
7CI
8Dxx 
9E 
10F 
11Gxx 
12H 
13Ix 
14 
15 
16
Sheet3
Cell Formulas
RangeFormula
U5U5=[@18]+1
V5:V15V5=IFERROR(INDEX([Name],SMALL(IF([Due?]<>"",IF([Col L]="",IF([Name]<>"",ROW([Name])-ROW(Table1[[#Headers],[Name]])))),ROWS(Table1[[#Headers],[Name]]:[@Name])-1)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.

But if you're using VBA to extract the names due for a review, you could bypass this calculation column entirely. Instead just use VBA to filter the table, and then your code can pick up the filtered names from column C.
 
Upvote 0
Another possibility is to use an Excel table. Then your formulae will automatically adjust down the columns if you add new rows.

Book3
ABCDEFGHIJKLMNOPQRSTUVW
1
2
3
4Name23456789Col L111213141516Due?1819Names due
5Ax1A
6BxB
7CI
8Dxx 
9E 
10F 
11Gxx 
12H 
13Ix 
14 
15 
16
Sheet3
Cell Formulas
RangeFormula
U5U5=[@18]+1
V5:V15V5=IFERROR(INDEX([Name],SMALL(IF([Due?]<>"",IF([Col L]="",IF([Name]<>"",ROW([Name])-ROW(Table1[[#Headers],[Name]])))),ROWS(Table1[[#Headers],[Name]]:[@Name])-1)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.

But if you're using VBA to extract the names due for a review, you could bypass this calculation column entirely. Instead just use VBA to filter the table, and then your code can pick up the filtered names from column C.
Thanks so much for taking the time to do this, Stephen. I will have to look at what is involved in converting my sheet to a table. I currently have multiple clinicians in a busy clinic accessing it. I am self taught so not the greatest with using Excel to its potential!!
 
Upvote 0
What version of Excel are you using?
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Thanks so much, Fluff. I have just updated my profile. :)
 
Upvote 0
Thanks for that (y)
As you have 365 another option is
Excel Formula:
=FILTER(C5:C10000,(S5:S10000<>"")*(L5:L10000="")*(C5:C10000<>""))
This just goes in one cell & will spill down.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,888
Messages
6,175,217
Members
452,619
Latest member
Shiv1198

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