Reverse array

Holger

Board Regular
Joined
Nov 22, 2017
Messages
94
Office Version
  1. 365
Platform
  1. MacOS
Hi,

over last few days I worked on arrays and with help from this forum I could go through bank transactions and assign categories and than group transactions by date, categories and sub-categories. Last help was from @Peter_SSs, who could assist in allowing me to get a table, for any transactions, that were not mapped. I put this all into live data and it works great. So very thankful for everyone's help.

I would now like to add what I call a reverse report for analytics:

* user can pick a sub-category from a drop-down field
* that should list all transactions that were mapped to that sub

I got maybe halfway there. In AP68 is my current status of transactions, based on user entry in cell AQ67 (no dropdown in this mock-up). I want to add to that array in AP68#:
* transaction date
* original description

I tried to add dates etc. but then the result array has endless rows, which has obviously to do with me not fully understanding this.

Thanks for any help.

Arrays - Find Partial String and Apply Category.xlsx
AOAPAQARASATAUAVAW
5TransactionsMapping
6TransDateTransactionAmountKeywordCatSub
72/1/25METRO PETROLEUM AVALON AVALON173.17PetroleumCarFuel
82/2/25DAVID JONES BURNLEY-34.95JonesLivingFashion
92/3/25PETSTOCK BELROSE BELROSE152.15PetstockPetPet Food
102/4/25GUZMAN Y GOMEZ SURRY HILLS58.50GuzmanLivingFood
112/5/25PETSTOCK MONA VALE MONA VALE50.95MekongLivingFood
122/6/25MEKONG MERCHANT 46146 AVALON BEACH32.04AdobeEductionTechnology
132/7/25ADOBE Adobe Systems SAGGART43.99icafeLivingCoffee
142/8/25LS ICAFE PTY LTD T/A C MONA VALE5.62PocketpizzLivingDining Out
152/9/25WWW.POCKETPIZZ* AVALON SYDNEY28.80WW MetroLivingFood
162/10/25WW METRO 8380 AVALON AVALON195.71HungryLivingDining Out
172/11/25HUNGRY JACKS PTY LTD WOOLLOOMOOLOO11.85HarbourfrontLivingDining Out
182/12/25HARBOURFRONT SEAFOOD RE THE ROCKS449.07ColesLivingFood
192/13/25COLES MONAVALE 884 MONA VALE278.06HarrisLivingFood
202/14/25HARRIS FARM MARKETS MONA VALE206.50MyerLivingFashion
212/15/25SYDNEY CITY SYDNEY99.50Chambers CellarFoodAlcohol
22ChargrillLifestyleRestaurants
231750.96Chef RebekaLifestyleRestaurants
24ChemisHealthPharmacy
25Chill BarLifestyleRestaurants
26
49
50
51
52Not Mapped - Option 1
53SYDNEY CITY SYDNEY99.5
54
55
56
57
58
59Not Mapped - Option 2
60SYDNEY CITY SYDNEY99.5
61
62
63
64
65
66
67Reverse ReportFood
6858.5Food
6932.04Food
70195.71Food
71278.06Food
72206.5Food
Expenses
Cell Formulas
RangeFormula
AQ23AQ23=SUM(AQ7:AQ22)
AP53:AQ53AP53=FILTER(AP7:AQ21,NOT(BYROW(AP7:AQ21,LAMBDA(r,COUNT(SEARCH(AU7:AU25,r))))),"all mapped")
AP60:AQ60AP60=FILTER(AP7:AQ21,BYROW(AP7:AQ21,LAMBDA(r,COUNT(SEARCH(AU7:AU25,r))=0)),"all mapped")
AP68:AQ72AP68=LET( check,AQ67, fil,FILTER(UNIQUE(AU7:AW25),AW7:AW25=check), k,INDEX(fil,,1), sub, INDEX(fil,,3), trans, AP7:AP21, sumcol, AQ7:AQ21, r,BYROW(k,LAMBDA(keyrow,SUMIFS(sumcol, trans,"*"&keyrow&"*",trans,"*"&keyrow&"*"))), HSTACK(r,sub) )
Dynamic array formulas.
 
I'm not sure why you would want "Food" repeated down the results since the value in AQ67 already indicates you want all values to have that category. So this is my suggestion:

25 02 24.xlsm
APAQARASATAUAVAW
5TransactionsMapping
6TransactionAmountKeywordCatSub
7METRO PETROLEUM AVALON AVALON173.17PetroleumCarFuel
8DAVID JONES BURNLEY-34.95JonesLivingFashion
9PETSTOCK BELROSE BELROSE152.15PetstockPetPet Food
10GUZMAN Y GOMEZ SURRY HILLS58.5GuzmanLivingFood
11PETSTOCK MONA VALE MONA VALE50.95MekongLivingFood
12MEKONG MERCHANT 46146 AVALON BEACH32.04AdobeEductionTechnology
13ADOBE Adobe Systems SAGGART43.99icafeLivingCoffee
14LS ICAFE PTY LTD T/A C MONA VALE5.62PocketpizzLivingDining Out
15WWW.POCKETPIZZ* AVALON SYDNEY28.8WW MetroLivingFood
16WW METRO 8380 AVALON AVALON195.71HungryLivingDining Out
17HUNGRY JACKS PTY LTD WOOLLOOMOOLOO11.85HarbourfrontLivingDining Out
18HARBOURFRONT SEAFOOD RE THE ROCKS449.07ColesLivingFood
19COLES MONAVALE 884 MONA VALE278.06HarrisLivingFood
20HARRIS FARM MARKETS MONA VALE206.5MyerLivingFashion
21SYDNEY CITY SYDNEY99.5Chambers CellarFoodAlcohol
22ChargrillLifestyleRestaurants
231750.96Chef RebekaLifestyleRestaurants
24ChemisHealthPharmacy
25Chill BarLifestyleRestaurants
26
27
65
66
67Reverse ReportFood
6858.5
6932.04
70195.71
71278.06
72206.5
73
Holger
Cell Formulas
RangeFormula
AQ23AQ23=SUM(AQ7:AQ22)
AQ68:AQ72AQ68=FILTER(AQ7:AQ21,BYROW(AP7:AP21,LAMBDA(r,COUNT(SEARCH(FILTER(AU7:AU25,AW7:AW25=AQ67),r)))),"None")
Dynamic array formulas.
 
Upvote 0
Thanks @Peter_SSs and no issue with not having that column repeated, however, what I would like to get added to the output is this:


Thanks again

Arrays - Find Partial String and Apply Category.xlsx
ANAOAPAQ
67Reverse ReportFood
682/4/25GUZMAN Y GOMEZ SURRY HILLS58.5Food
692/6/25MEKONG MERCHANT 46146 AVALON BEACH32.04Food
702/10/25WW METRO 8380 AVALON AVALON195.71Food
712/13/25COLES MONAVALE 884 MONA VALE278.06Food
722/14/25HARRIS FARM MARKETS MONA VALE206.5Food
Expenses
Cell Formulas
RangeFormula
AP68:AQ72AP68=LET( check,AQ67, fil,FILTER(UNIQUE(AU7:AW25),AW7:AW25=check), k,INDEX(fil,,1), sub, INDEX(fil,,3), trans, AP7:AP21, sumcol, AQ7:AQ21, r,BYROW(k,LAMBDA(keyrow,SUMIFS(sumcol, trans,"*"&keyrow&"*",trans,"*"&keyrow&"*"))), HSTACK(r,sub) )
Dynamic array formulas.
 
Upvote 0
no issue with not having that column repeated
In that case wouldn't it just need this one reference changed from my previous formula?
=FILTER(AQ7:AQ21,BYROW(AP7:AP21,LAMBDA(r,COUNT(SEARCH(FILTER(AU7:AU25,AW7:AW25=AQ67),r)))),"None")
=FILTER(AO7:AQ21,BYROW(AP7:AP21,LAMBDA(r,COUNT(SEARCH(FILTER(AU7:AU25,AW7:AW25=AQ67),r)))),"None")

25 02 24.xlsm
AOAPAQARAUAVAW
5TransactionsMapping
6TransDateTransactionAmountKeywordCatSub
72/1/25METRO PETROLEUM AVALON AVALON173.17PetroleumCarFuel
82/2/25DAVID JONES BURNLEY-34.95JonesLivingFashion
92/3/25PETSTOCK BELROSE BELROSE152.15PetstockPetPet Food
102/4/25GUZMAN Y GOMEZ SURRY HILLS58.5GuzmanLivingFood
112/5/25PETSTOCK MONA VALE MONA VALE50.95MekongLivingFood
122/6/25MEKONG MERCHANT 46146 AVALON BEACH32.04AdobeEductionTechnology
132/7/25ADOBE Adobe Systems SAGGART43.99icafeLivingCoffee
142/8/25LS ICAFE PTY LTD T/A C MONA VALE5.62PocketpizzLivingDining Out
152/9/25WWW.POCKETPIZZ* AVALON SYDNEY28.8WW MetroLivingFood
162/10/25WW METRO 8380 AVALON AVALON195.71HungryLivingDining Out
172/11/25HUNGRY JACKS PTY LTD WOOLLOOMOOLOO11.85HarbourfrontLivingDining Out
182/12/25HARBOURFRONT SEAFOOD RE THE ROCKS449.07ColesLivingFood
192/13/25COLES MONAVALE 884 MONA VALE278.06HarrisLivingFood
202/14/25HARRIS FARM MARKETS MONA VALE206.5MyerLivingFashion
212/15/25SYDNEY CITY SYDNEY99.5Chambers CellarFoodAlcohol
22ChargrillLifestyleRestaurants
231750.96Chef RebekaLifestyleRestaurants
24ChemisHealthPharmacy
25Chill BarLifestyleRestaurants
26
27
65
66
67Reverse ReportFood
682/4/25GUZMAN Y GOMEZ SURRY HILLS58.50
692/6/25MEKONG MERCHANT 46146 AVALON BEACH32.04
702/10/25WW METRO 8380 AVALON AVALON195.71
712/13/25COLES MONAVALE 884 MONA VALE278.06
722/14/25HARRIS FARM MARKETS MONA VALE206.50
73
Holger
Cell Formulas
RangeFormula
AQ23AQ23=SUM(AQ7:AQ22)
AO68:AQ72AO68=FILTER(AO7:AQ21,BYROW(AP7:AP21,LAMBDA(r,COUNT(SEARCH(FILTER(AU7:AU25,AW7:AW25=AQ67),r)))),"None")
Dynamic array formulas.
 
Upvote 0
Solution
In that case wouldn't it just need this one reference changed from my previous formula?
=FILTER(AQ7:AQ21,BYROW(AP7:AP21,LAMBDA(r,COUNT(SEARCH(FILTER(AU7:AU25,AW7:AW25=AQ67),r)))),"None")
=FILTER(AO7:AQ21,BYROW(AP7:AP21,LAMBDA(r,COUNT(SEARCH(FILTER(AU7:AU25,AW7:AW25=AQ67),r)))),"None")

25 02 24.xlsm
AOAPAQARAUAVAW
5TransactionsMapping
6TransDateTransactionAmountKeywordCatSub
72/1/25METRO PETROLEUM AVALON AVALON173.17PetroleumCarFuel
82/2/25DAVID JONES BURNLEY-34.95JonesLivingFashion
92/3/25PETSTOCK BELROSE BELROSE152.15PetstockPetPet Food
102/4/25GUZMAN Y GOMEZ SURRY HILLS58.5GuzmanLivingFood
112/5/25PETSTOCK MONA VALE MONA VALE50.95MekongLivingFood
122/6/25MEKONG MERCHANT 46146 AVALON BEACH32.04AdobeEductionTechnology
132/7/25ADOBE Adobe Systems SAGGART43.99icafeLivingCoffee
142/8/25LS ICAFE PTY LTD T/A C MONA VALE5.62PocketpizzLivingDining Out
152/9/25WWW.POCKETPIZZ* AVALON SYDNEY28.8WW MetroLivingFood
162/10/25WW METRO 8380 AVALON AVALON195.71HungryLivingDining Out
172/11/25HUNGRY JACKS PTY LTD WOOLLOOMOOLOO11.85HarbourfrontLivingDining Out
182/12/25HARBOURFRONT SEAFOOD RE THE ROCKS449.07ColesLivingFood
192/13/25COLES MONAVALE 884 MONA VALE278.06HarrisLivingFood
202/14/25HARRIS FARM MARKETS MONA VALE206.5MyerLivingFashion
212/15/25SYDNEY CITY SYDNEY99.5Chambers CellarFoodAlcohol
22ChargrillLifestyleRestaurants
231750.96Chef RebekaLifestyleRestaurants
24ChemisHealthPharmacy
25Chill BarLifestyleRestaurants
26
27
65
66
67Reverse ReportFood
682/4/25GUZMAN Y GOMEZ SURRY HILLS58.50
692/6/25MEKONG MERCHANT 46146 AVALON BEACH32.04
702/10/25WW METRO 8380 AVALON AVALON195.71
712/13/25COLES MONAVALE 884 MONA VALE278.06
722/14/25HARRIS FARM MARKETS MONA VALE206.50
73
Holger
Cell Formulas
RangeFormula
AQ23AQ23=SUM(AQ7:AQ22)
AO68:AQ72AO68=FILTER(AO7:AQ21,BYROW(AP7:AP21,LAMBDA(r,COUNT(SEARCH(FILTER(AU7:AU25,AW7:AW25=AQ67),r)))),"None")
Dynamic array formulas.
Thanks @Peter_SSs it works in the test data and I’ll try tomorrow to implement in the LIVE data. Clearly a long way to go for my array learnings (😉).
 
Upvote 0

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