Dynamic Array Formula (FILTER) But Show the Other Criteria with Blank

staticfluids

New Member
Joined
Apr 24, 2024
Messages
8
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
  2. Mobile
  3. Web
Hi, first of all, sorry for my bad English.

I have been looking for a solution here, trial and error by myself, and the Microsoft forum as well. But haven't found any solution that satisfies the needs. I think it's possible but I don't know how to put it into Excel formula.

The logic is like this:
FILTER --> if found "THE CRITERIA DATA" OR "THE SECOND CRITERIA DATA", return the value from column 1 until column 8 --> if the value from the column 3 is not "THE CRITERIA DATA" OR "THE SECOND CRITERIA DATA", return the value to blank or ""


I have data like this from cell A2 to H55 (the original data is a table, but i put the sample only):

RowDateContentsAmountTierDonePeriodeRemarks
2​
26 March 2022​
Other Tier 0 #1Rp 11,400,000.00
0​
Yes
01 March 2022​
3​
26 March 2022​
Other Tier 6 #1Rp 620,000.00
6​
No
01 March 2022​
4​
26 March 2022​
Other Tier 6 #2Rp 270,000.00
6​
No
01 March 2022​
5​
26 March 2022​
Other Tier 6 #3Rp 60,000.00
6​
Recheck
01 March 2022​
6​
26 March 2022​
Other Tier 5 #1Rp 250,000.00
5​
Yes
01 March 2022​
7​
05 May 2022​
Other Tier 0 #4Rp 100,000.00
1​
Yes
01 March 2022​
8​
22 April 2022​
THE CRITERIA DATARp 500,000.00
1​
Yes
01 March 2022​
9​
01 April 2022​
THE CRITERIA DATARp 400,000.00
1​
Yes
01 March 2022​
10​
01 April 2022​
THE SECOND CRITERIA DATARp 700,000.00
1​
Yes
01 March 2022​
11​
13 March 2022​
THE SECOND CRITERIA DATARp 300,000.00
1​
Yes
01 March 2022​
12​
26 March 2022​
Other Tier 1 #1Rp 200,000.00
1​
Yes
01 March 2022​
13​
26 March 2022​
Other Tier 1 #2Rp 500,000.00
1​
Yes
01 March 2022​
14​
26 March 2022​
Other Tier 2 #1Rp 100,000.00
2​
Recheck
01 March 2022​
15​
26 March 2022​
Other Tier 2 #2Rp 200,000.00
2​
Recheck
01 March 2022​
16​
26 March 2022​
Other Tier 2 #3Rp 2,070,000.00
2​
Yes
01 March 2022​
17​
26 March 2022​
Other Tier 2 #4Rp 225,000.00
2​
Yes
01 March 2022​
18​
26 March 2022​
Other Tier 3 #1Rp 50,000.00
3​
Yes
01 March 2022​
19​
26 March 2022​
Other Tier 3 #2Rp 85,000.00
3​
Yes
01 March 2022​
20​
26 March 2022​
Other Tier 3 #3Rp 350,000.00
3​
Yes
01 March 2022​
21​
26 March 2022​
Other Tier 3 #4Rp 275,000.00
3​
Yes
01 March 2022​
22​
26 March 2022​
Other Tier 3 #5Rp 150,000.00
3​
Yes
01 March 2022​
23​
26 March 2022​
Other Tier 3 #6Rp 2,500,000.00
3​
Yes
01 March 2022​
24​
26 March 2022​
Other Tier 3 #7Rp 150,000.00
3​
Yes
01 March 2022​
25​
26 March 2022​
Other Tier 3 #8Rp 52,000.00
3​
Yes
01 March 2022​
26​
26 March 2022​
Other Tier 3 #9Rp 1,355,000.00
3​
Yes
01 March 2022​
27​
26 February 2022​
Other Tier 0 #2Rp 10,620,000.00
0​
Yes
01 February 2022​
28​
26 February 2022​
Other Tier 6 #4Rp 510,000.00
6​
No
01 February 2022​
29​
26 February 2022​
Other Tier 6 #5Rp 260,000.00
6​
No
01 February 2022​
30​
26 February 2022​
Other Tier 6 #6Rp 60,000.00
6​
Recheck
01 February 2022​
31​
13 March 2022​
THE CRITERIA DATARp 1,000,000.00
1​
Yes
01 February 2022​
32​
28 February 2022​
THE CRITERIA DATARp 1,000,000.00
1​
Yes
01 February 2022​
33​
13 March 2022​
THE SECOND CRITERIA DATARp 700,000.00
1​
Yes
01 February 2022​
34​
28 February 2022​
THE SECOND CRITERIA DATARp 1,000,000.00
1​
Yes
01 February 2022​
35​
11 February 2022​
THE SECOND CRITERIA DATARp 100,000.00
1​
Yes
01 February 2022​
36​
26 January 2022​
THE SECOND CRITERIA DATARp 200,000.00
1​
Yes
01 February 2022​
37​
26 February 2022​
Other Tier 1 #3Rp 1,500,000.00
1​
Yes
01 February 2022​
38​
26 February 2022​
Other Tier 2 #5Rp 200,000.00
2​
Recheck
01 February 2022​
39​
26 February 2022​
Other Tier 2 #6Rp 200,000.00
2​
Recheck
01 February 2022​
40​
26 February 2022​
Other Tier 2 #7Rp 1,930,000.00
2​
Yes
01 February 2022​
41​
26 February 2022​
Other Tier 3 #10Rp 250,000.00
3​
Yes
01 February 2022​
42​
26 February 2022​
Other Tier 3 #11Rp 175,000.00
3​
Yes
01 February 2022​
43​
26 February 2022​
Other Tier 3 #12Rp 100,000.00
3​
Yes
01 February 2022​
44​
26 February 2022​
Other Tier 3 #13Rp 350,000.00
3​
Yes
01 February 2022​
45​
26 February 2022​
Other Tier 3 #14Rp 40,000.00
3​
Yes
01 February 2022​
46​
26 February 2022​
Other Tier 3 #15Rp 100,000.00
3​
Yes
01 February 2022​
47​
26 February 2022​
Other Tier 3 #16Rp 200,000.00
3​
Yes
01 February 2022​
48​
26 February 2022​
Other Tier 3 #17Rp 40,000.00
3​
Yes
01 February 2022​
49​
26 February 2022​
Other Tier 3 #18Rp 105,000.00
3​
Yes
01 February 2022​
50​
26 February 2022​
Other Tier 3 #19Rp 110,000.00
3​
Yes
01 February 2022​
51​
26 January 2022​
Other Tier 0 #3Rp 3,175,000.00
0​
Yes
01 January 2022​
52​
26 January 2022​
Other Tier 6 #7Rp -
6​
No
01 January 2022​
53​
26 January 2022​
Other Tier 6 #8Rp 80,000.00
6​
No
01 January 2022​
54​
26 January 2022​
Other Tier 6 #9Rp 20,000.00
6​
Recheck
01 January 2022​
55​
26 January 2022​
Other Tier 3 #20Rp 3,075,000.00
3​
Yes
01 January 2022​

I wanted to put the dynamic formula in another cell so it updates accordingly with its original rows.

I tried to use the FILTER formula at cell J2, the output is like this:
Excel Formula:
=FILTER(A2:H55,(C2:C55 = "THE CRITERIA DATA") + (C2:C55 = "THE SECOND CRITERIA DATA"))

RowDateContentsAmountTierDonePeriodeRemarks
8​
22-Apr-22​
THE CRITERIA DATARp 500,000.00
1​
Yes
01-Mar-22​
9​
01-Apr-22​
THE CRITERIA DATARp 400,000.00
1​
Yes
01-Mar-22​
10​
01-Apr-22​
THE SECOND CRITERIA DATARp 700,000.00
1​
Yes
01-Mar-22​
11​
13-Mar-22​
THE SECOND CRITERIA DATARp 300,000.00
1​
Yes
01-Mar-22​
31​
13-Mar-22​
THE CRITERIA DATARp 1,000,000.00
1​
Yes
01-Feb-22​
32​
28-Feb-22​
THE CRITERIA DATARp 1,000,000.00
1​
Yes
01-Feb-22​
33​
13-Mar-22​
THE SECOND CRITERIA DATARp 700,000.00
1​
Yes
01-Feb-22​
34​
28-Feb-22​
THE SECOND CRITERIA DATARp 1,000,000.00
1​
Yes
01-Feb-22​
35​
11-Feb-22​
THE SECOND CRITERIA DATARp 100,000.00
1​
Yes
01-Feb-22​
36​
26-Jan-22​
THE SECOND CRITERIA DATARp 200,000.00
1​
Yes
01-Feb-22​

The filtered data is correct, but what I want is like this:

this is using simple IF formula plus the criteria and then i have to drag it all down from S2 until Z55
Excel Formula:
=IF(OR($C2="THE CRITERIA DATA",$C2="THE SECOND CRITERIA DATA"),A2,"")

RowDateContentsAmountTierDonePeriodeRemarks
8​
22-Apr-22​
THE CRITERIA DATARp 500,000.00
1​
Yes
01-Mar-22​
9​
01-Apr-22​
THE CRITERIA DATARp 400,000.00
1​
Yes
01-Mar-22​
10​
01-Apr-22​
THE SECOND CRITERIA DATARp 700,000.00
1​
Yes
01-Mar-22​
11​
13-Mar-22​
THE SECOND CRITERIA DATARp 300,000.00
1​
Yes
01-Mar-22​
31​
13-Mar-22​
THE CRITERIA DATARp 1,000,000.00
1​
Yes
01-Feb-22​
32​
28-Feb-22​
THE CRITERIA DATARp 1,000,000.00
1​
Yes
01-Feb-22​
33​
13-Mar-22​
THE SECOND CRITERIA DATARp 700,000.00
1​
Yes
01-Feb-22​
34​
28-Feb-22​
THE SECOND CRITERIA DATARp 1,000,000.00
1​
Yes
01-Feb-22​
35​
11-Feb-22​
THE SECOND CRITERIA DATARp 100,000.00
1​
Yes
01-Feb-22​
36​
26-Jan-22​
THE SECOND CRITERIA DATARp 200,000.00
1​
Yes
01-Feb-22​


My question is, is it possible to use a dynamic formula like FILTER to put the desired output like the expected result?

It seems possible but until now i haven't found the solution yet. Me personally think it has something to do with IFERROR/MAP/LAMBDA/CHOOSECOLS/CHOOSEROW/VSTACK/HSTACK formula.


Thank you all, have a blessed day
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try:
VBA Code:
=MAKEARRAY(ROWS(A2:G55),COLUMNS(A2:G55),
LAMBDA(r,c,IF((INDEX(C2:C55,r)="THE CRITERIA DATA")+(INDEX(C2:C55,r)="THE SECOND CRITERIA DATA"),INDEX(A2:G55,r,c),"")))
 
Upvote 1
Solution
Try:
VBA Code:
=MAKEARRAY(ROWS(A2:G55),COLUMNS(A2:G55),
LAMBDA(r,c,IF((INDEX(C2:C55,r)="THE CRITERIA DATA")+(INDEX(C2:C55,r)="THE SECOND CRITERIA DATA"),INDEX(A2:G55,r,c),"")))
Thank you! It works like a charm!

Another question, this formula seems not to work with wildcards. I tried to change:
(INDEX(C2:C55,r)="THE CRITERIA DATA")+(INDEX(C2:C55,r)="THE SECOND CRITERIA DATA")
into
(INDEX(C2:C55,r)="*DATA*")

But it's not showing "THE CRITERIA DATA" nor "THE SECOND CRITERIA DATA". I want to make the formula simpler if I have to filter some data that have similar words without having to change them one by one inside the formula.

Do you mind me asking, which formula should I modify to make it work with wildcard? thanks!
 
Upvote 0
For wildcard searches you'd need to use SEARCH().
Excel Formula:
=MAKEARRAY(ROWS(A2:G55),COLUMNS(A2:G55),
LAMBDA(r,c,IF((ISNUMBER(SEARCH("CRITERIA1",INDEX(C2:C55,r))))+(ISNUMBER(SEARCH("CRITERIA2",INDEX(C2:C55,r)))),INDEX(A2:G55,r,c),"")))
 
Upvote 1
For wildcard searches you'd need to use SEARCH().
Excel Formula:
=MAKEARRAY(ROWS(A2:G55),COLUMNS(A2:G55),
LAMBDA(r,c,IF((ISNUMBER(SEARCH("CRITERIA1",INDEX(C2:C55,r))))+(ISNUMBER(SEARCH("CRITERIA2",INDEX(C2:C55,r)))),INDEX(A2:G55,r,c),"")))
Thank you so much, you are being very helpful! I've been working on this for a week and not finding any solution everywhere. Have a great day!
 
Upvote 0

Forum statistics

Threads
1,215,680
Messages
6,126,188
Members
449,297
Latest member
Berek82

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