Budget Array Formula lookup pulling transactions in wrong order

ExcelGrinch

New Member
Joined
Nov 22, 2018
Messages
1
Hi Excel Guru's!

I have one that I'm stuck on and hoping someone might be able to assist with..

Context:
I'm building a budget workbook, comprised of an overview and transaction sheet, the layout for which is below.

The transaction sheet is just a dump of my bank transactions and then I use Type/Subtype to assign relevant budget information.
As an aside, I have a check column which combines a few columns to validate if the transaction is unique. The caveat with this is that the Actual date and Processed date can differ on my transaction statement.

Table 'Transactions'
DateCheck (Used for finding duplicate transactions w/Conditional formatting)
-Open to other ideas on identifying duplicates
DescriptionTypeSub TypeAmount
23/11/2018See below table for codeTransfer to SavingsExpensesSavings99
23/11/2018As abovePC PartsExpensesShopping88
23/11/2018As aboveFoodExpensesGroceries66
24/11/2018As aboveTakeoutExpensesEating Out77

<tbody>
</tbody>

Used to check for duplicates

Code:
=IF(A1="","",TEXT(A1,"mm")
&
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(UPPER(SUBSTITUTE(C1," ","")),"VISAPURCHASE",""),"PTYL","PTY"),":",""),"YTD","Y"),"VISA","")&F1)

On the overview sheet, I am trying to query the above table to find transactions that are between two dates, match the Type and then use Small() to grab the top (highest expense) 5.

This is the formula I am using to find the cell address of the top transaction that meets that criteria.

Used to find the highest expense within two date ranges, where the type is Expense
Code:
{=IFERROR(ADDRESS(SMALL(IF(IF((Transactions[Date]>=$F$22)*(Transactions[Date]<$G$22),Transactions[Type])="Expenses",ROW(Transactions[Amount])), ROW(1:1)),6,1,1,"[New Budget.xlsm]Transactions"),"")}

But, I have found that it is not actually sorting by size. Instead the small appears to be sorting by date, oldest to newest.
Using the below table as an example, row 4 should be row 3 and I think this has something to do with the if ranges I am using.

DateDescriptionTypeAmount
23/11/2018Transfer to SavingsSavings99
23/11/2018PC PartsShopping88
23/11/2018FoodGroceries66
24/11/2018Take outEating Out77
etcetcetcetc

<tbody>
</tbody>


I also tried using this formula, but found that it was matching the amount, rather than the row found by the if ranges.

Code:
=IFERROR(CELL("address",INDEX(Transactions[Amount],MATCH(SMALL(IF(IF((Transactions[Date]>=$F$22)*(Transactions[Date]<$G$22),Transactions[Type],"")="Expenses",Transactions[Amount],""),1),Transactions[Amount],0))),"")

I think I have all the pieces, but I can't seem to put them together correctly.
I am hoping someone might be able to assist with getting me over this hurdle and if a better idea to filter out duplicate transactions comes up, I would be very interested and forever grateful.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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