No light at my byRow Tunnel

Holger

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

in a recent post, I asked for help re arrays formulas and searching for matching strings and then apply categories. @Eric W was kind enough to jump on this and provide a solution, that works, which I'm grateful for.

However, as Eric is not on M365 his solution does not use ie byRow and other newer array formulas. So I thought, easy enough to adjust his solution....

And this is, where I'm stuck. I can't seem to get that working.

* I managed to get the search function working to search keyword columns from the mapping table to transaction in the transaction table and if found, return the category from the mapping table
* I also managed to get sumifs working to aggregate results
* I know that byRow can use the above function but I don't get this solved, so I must be making a mistake somewhere



test.xlsx
ZAAABACADAEAF
6Transaction TableMapping Table
7
8TransactionAmountKeywordCategory
9Coles Transaction15ColesColes & Woolworth
10Woolworth Transaction15WoolworthColes & Woolworth
11Harris Farm15HarrisHarris Farm
12Nespresso Transaction15NespressoNespresso
13Nestle Transaction15NestleNespresso
14Petstock15PetPet Food
15Kmart Transaction15KmartKmart, Target, Amazon
16Target Transaction15TargetKmart, Target, Amazon
17Amazon Transaction15AmazonKmart, Target, Amazon
18Nespresso Transaction15StanleyKmart, Target, Amazon
19
20
21
22
23
24
25
26
27SearchbyRow
28Coles & Woolworth#CALC!
29Coles & Woolworth
30Harris Farm
31Nespresso
32Nespresso
33Pet Food
34Kmart, Target, Amazon
35Kmart, Target, Amazon
36Kmart, Target, Amazon
37
38
39
40Sumifs
4115
4215
4315
4430
4515
4615
4715
4815
4915
500
Expenses
Cell Formulas
RangeFormula
Z28:Z37Z28=IF(ISNUMBER(SEARCH(AE9:AE18,"*"&Z9:Z18&"*")),AF9:AF18,"")
AC28AC28=BYROW(AA9:AA18, LAMBDA(row, SUMIFS(row,Z9:Z18,"*"&AE9:AE18&"*")))
Z41:Z50Z41=SUMIFS(AA9:AA18,Z9:Z18,"*"&AE9:AE18&"*")
Dynamic array formulas.


Any help would be great.


Thanks very much
 
Thanks @Dave Patton trying to make it work and this is where I'm stuck (again 😩):

* Currently the arrays are all the same length, is this required? If I make the arrays AS# and AN# smaller than AM#, AN#,AO# I get value# error in pivotby formula?
* Cofee should be 45 but it looks like it is not picking up the last Nespresso transaction? It even shows that as not mapped....
* Lastly, in this test, I added the category to the transaction table, which is impractical with the real data. Is there a way to do the grouping/pivoting in the fly?


Any further help would be awesome.

Thank You!


Test.xlsx
AMANAOAPAQARASAT
5 Dec-24Jan-25Total
6Coffee3030
7Food153045
8Household1515
9Pet1515
1004545
11Total15135150
12
13
14Transaction Table
15DateTransactionAmountCategoryMapping
1612/12/2024Coles Transaction15FoodColesFood
171/01/2025Woolworth Transaction15FoodWoolworthFood
1815/01/2025Harris Farm15FoodHarrisFood
1915/01/2025Nespresso Transaction15CoffeeNespressoCoffee
2015/01/2025Nestle Transaction15CoffeeNestlCoffee
2115/01/2025Petstock15PetPetPet
2215/01/2025Kmart Transaction15HouseholdKmartHousehold
2331/01/2025Target Transaction15Not mapped
2431/01/2025Amazon Transaction15Not mapped
2531/01/2025Nespresso Transaction15Not mapped
Expenses
Cell Formulas
RangeFormula
AN5:AQ11AN5=PIVOTBY(AT16:AT25,TEXT(AM16:AM25,"mmm-yy"),AO16:AO25, SUM,,,,,,ISNUMBER(SEARCH(AS16:AS25,AN16:AN25)))
AP16:AP25AP16=IF(ISNUMBER(SEARCH(AS16:AS22,AN16:AN25)),AT16:AT22,"Not mapped")
Dynamic array formulas.
 
Last edited:
Upvote 0
Quick comments
1. I often include Albert Einstein's quote "As simple as possible, but not too simple".
2. I would keep the ranges the same length. N.B. The data that I posted was in a Table.
3. In a real application you may need to have the flexibility to edit the assigned Category.
I converted the Category column to values.
4. The "Not Mapped" show as a blank category on your post. In the following they show as "Not Mapped".

T202502a.xlsm
AMANAOAP
5 24-1225-01Total
6Coffee3030
7Food153045
8Household1515
9Not mapped4545
10Pet1515
11Total15135150
12
13
14Transactions
15DateTransactionAmountCategory
1612-Dec-24Coles Transaction15Food
171-Jan-25Woolworth Transaction15Food
1815-Jan-25Harris Farm15Food
1915-Jan-25Nespresso Transaction15Coffee
2015-Jan-25Nestle Transaction15Coffee
2115-Jan-25Petstock15Pet
2215-Jan-25Kmart Transaction15Household
2331-Jan-25Target Transaction15Not mapped
2431-Jan-25Amazon Transaction15Not mapped
2531-Jan-25Nespresso Transaction15Not mapped
26
6aa
Cell Formulas
RangeFormula
AM5:AP11AM5=PIVOTBY(AP16:AP25,TEXT(AM16:AM25,"yy-mm"),AO16:AO25,SUM)
Dynamic array formulas.
 
Upvote 0
Thanks for your feedback. The category will need to remain as part of a mapping table as we are talking about hundreds of rows/transactions. Consequently, the mapping table will have a different number of rows, then the transaction table. Keeping them the same length I think is not practical.
 
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