Extend Array Formula

neodjandre

Well-known Member
Joined
Nov 29, 2006
Messages
950
Office Version
  1. 2019
Platform
  1. Windows
I am using this array formula which works fine:

=IF(ROWS(K$62:K62)>COUNTIF(accounts_table[§],"=P"),"",INDEX(accounts_table[Account Name],SMALL(IF(accounts_table[§]="P",ROW(accounts_table[§])-ROW(Ledger!$H$17)+1),ROWS($K$62:K62))))

however I need to add another OR condition:

accounts_table[§],"=B"

I haven't been able to make this work. I presume two changes need to happen to the formula above for this to work.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Maybe try
=IF(ROWS(K$62:K62)>sum(COUNTIF(accounts_table[§],{"P","B"}),"",INDEX(accounts_table[Account Name],SMALL(IF((accounts_table[§]="P")+(
accounts_table[§]="B"),ROW(accounts_table[§])-ROW(Ledger!$H$17)+1),ROWS($K$62:K62))))
 
Upvote 0
Control+shift+enter:

=IF(ROWS(K$62:K62)>SUM(COUNTIF(accounts_table[§],{"P","B"})),"",INDEX(accounts_table[Account Name],SMALL(IF(ISNUMBER(MATCH(accounts_table[§],{"P","B"},0)),ROW(accounts_table[§])-ROW(INDEX(accounts_table[§],1,1))+1),ROWS($K$62:K62))))
 
Last edited:
Upvote 0
Another one

=IF(ROWS(K$62:K62)>sum(COUNTIF(accounts_table[§],{"P","B"}),"",INDEX(accounts_table[Account Name],SMALL(IF(accounts_table[§]={"P","B"}
,ROW(accounts_table[§])-ROW(Ledger!$H$17)+1),ROWS($K$62:K62))))
 
Upvote 0

Forum statistics

Threads
1,223,977
Messages
6,175,753
Members
452,667
Latest member
vanessavalentino83

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