Forum Discussion
Can you use AND / OR in an INDEX MATCH
HansVogelaar
Hi Hans, thank you for the response. Really appreciate your efforts in providing the suggested solution. Column B in the expense & income sheets indeed contains the entry numbers.
Unfortunately, it does not work. I realize that my explanation might not have been totally complete. Cell B4 is referring to the value in the drop-down list from where I can select the account number.
I've tried to tweak the formula a bit to make it point to the correct cell reference, but it still does not work.
Hopefully, the below screenshots provide more insights.
In cell B9 it should always get the first possible record from the expense or income sheet that contains the selected account number.
Cell B10 will then pull the next record, B11 the record after that, etc. until the final record has been listed.
If both income and expense sheet records can be pulled chronologically, that would be awesome, but I realize that might be quite a challenge, so it's okay to list the expense records first, and after that the income records for that relevant account.
Hope this helps and thank you again! 🙂
Second, I would strongly recommend you consider re-doing you workbook to have ALL entries in ONE table and then have other tabs as reports (expense report just filters all the expense lines, Income report filters all the income lines, account reports ...)
Third, I recommend you make use of the the 'Format as a Table' function on the Home menu. This will let you refer to data based on a Table reference instead of columns so instead of Income!$B:$B it might be Income[Voucher Number]. This makes it easier to work with, easier to read (once you get used to it) and then excel only looks at the data rows instead of the entire column of the worksheet (over a million rows). For the below I will pretend you format the Income table as a table called INCOME and the Expense table as a table called EXPENSE.
So a solution to the existing, with Excel 365 you should be able to use:
=SORT(VSTACK(FILTER(INCOME, INCOME[Account Number]=$B$4, ""),FILTER(EXPENSE, EXPENSE[Account Number]=$B$4)))
- joostbr1965Feb 06, 2023Copper ContributorMy apologies for replying to an old thread.
The tables have been formatted as and the formula has been really helpful, it's working now with a bit of tweaking and testing. Really appreciate all the help! Have a great day!