FILTER Function & MAP/LAMBDA through Different Ranges & Arrays

MrRajKumar

Active Member
Joined
Jan 29, 2008
Messages
291
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have the following data. Places are unique, no duplicate.

A1:C10

ItemPlaceStatus
APlace 1Active
APlace 2Inactive
BPlace 3Active
BPlace 4Active
APlace 5Active
APlace 6Active
CPlace 7Active
CPlace 8Active
CPlace 9Active

E1:G9

PlaceStatusDate
Place 1Off
3/1/2024​
Place 1Good
2/25/2024​
Place 2Good
3/25/2024​
Place 4Good
1/1/2024​
Place 6Off
1/1/2024​
Place 7Away
2/1/2024​
Place 9Off
1/1/2024​
Place 9Good
2/1/2024​

Then, I have the following.

I2, to get unique Items

=UNIQUE(A2:A10)

J2, to get count of active places in each items.

=COUNTIFS(A2:A10,I2#,C2:C10,"Active")

In k2, i would like to get the count based on the following conditions. I would like to get the formula that support dynamic array.

1). Take 'Active' places from B2:B10 of the corresponding Item.
2). Look their 'Status' from F2;F9. if 'Status' is "<>Off"
3). Date in G2:G9 is <=Today().

Here is the final count.

A
1​
B
1​
C
2​

I tried the following formula to get corresponding array of places, but no luck.

=MAP(I2#,LAMBDA(a,FILTER(B2:B10,A2:A10=a)))
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
How about
Excel Formula:
=MAP(I2#,LAMBDA(m,SUM(COUNTIFS(E:E,FILTER(B2:B10,(A2:A10=m)*(C2:C10="active")),F:F,"<>Off",G:G,"<="&TODAY()))))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,943
Messages
6,175,547
Members
452,652
Latest member
eduedu

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