The small business bookkeeping file has eleven accounts. Two are Income: Client fees and Other income. Nine are Expense: Advertising, Contract labor, Insurance, Legal, Software, Supplies, Travel, Meals, and Phone.
On that file the account cell is one list of all eleven names. The list is the named range AccountNames. Kind is its own list, Income or Expense. Picking Expense does not shorten the account list. This article is how to make the second list depend on the first. It does not change the file.
Name the two lists
Put the Income accounts in A2:A3 and the Expense accounts in B2:B10. Select A2:A3 and name it Income. Select B2:B10 and name it Expense. Type the name in the name box, or use Name Manager.
A name cannot contain a space. Other income can be an item in the Income list. It cannot be the name of the range. The kind cell has to contain the name itself, Income or Expense, with no extra space. Excel names are not case-sensitive. Expense and expense find the same range.
The kind cell gets a list too. Data validation, List, and a source of Income,Expense. In a US Excel that comma is the list separator. A1 and B1 on the picture are those two words, so the source can be =$A$1:$B$1 instead of a typed list.
What INDIRECT returns
INDIRECT turns text into a reference. On the picture, E2 holds the characters B2:B10. That text is not a reference until INDIRECT runs. B2 is Advertising, so the first cell of the range is Advertising. The second is Contract labor. The third is Insurance. Nine names run from B2 through B10, and the last is Phone.
=INDEX(INDIRECT(E2),1)| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Income | Expense | Kind | Range text | From that list | |
| 2 | Client fees | Advertising | Expense | B2:B10 | Advertising | |
| 3 | Other income | Contract labor | Contract labor | |||
| 4 | Insurance | Insurance | ||||
| 5 | Legal | |||||
| 6 | Software | |||||
| 7 | Supplies | |||||
| 8 | Travel | |||||
| 9 | Meals | |||||
| 10 | Phone |
=INDEX(INDIRECT(E2),1)
The dropdown does not use that address. Name the range Expense, put Expense in the kind cell D2, and set the account cell’s data validation to a List whose source is:
=INDIRECT(D2)
INDIRECT of the word Expense returns the named range. Change D2 to Income and the same formula returns Client fees and Other income. That is the whole dependent list. It works in Excel 2010, which is the version the bookkeeping file is built for.
Use the name, not the text B2:B10. The INDIRECT page shows why. There the text B6 points at the Texas rate, 6.25%, and inserting a row does not change the text, so it can point at a different cell. A normal formula =B6 would have moved. A named range moves with the cells. The text B2:B10 does not.
INDIRECT of a blank cell, or of a name you never defined, is #REF!. A trailing space in the kind cell does the same thing, because the name is Expense and the cell says Expense.
Changing the kind from Expense to Income does not clear the account cell. If it still says Advertising, that word is no longer on the list. The validation list changes. The old value stays until you pick again.
The spill, if you have it
The same eleven rows can sit in one column, with the kind beside the account. UNIQUE of the kind column spills one of each value, in the order they first appear. Income is first, then Expense. FILTER of the account column, where the kind equals the pick in C2, spills the matches in sheet order. C2 is Expense, so the first three matches are Advertising, Contract labor, and Insurance. The full spill is the nine expense accounts. COUNTIF of the word Expense on those eleven rows is 9.
=INDEX(FILTER(B2:B12,A2:A12=C2),1)| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Kind | Account | Pick | Kinds | Matches |
| 2 | Income | Client fees | Expense | Income | Advertising |
| 3 | Income | Other income | Expense | Contract labor | |
| 4 | Expense | Advertising | 9 | Insurance | |
| 5 | Expense | Contract labor | |||
| 6 | Expense | Insurance | |||
| 7 | Expense | Legal | |||
| 8 | Expense | Software | |||
| 9 | Expense | Supplies | |||
| 10 | Expense | Travel | |||
| 11 | Expense | Meals | |||
| 12 | Expense | Phone |
=FILTER(B2:B12,A2:A12=C2)
The picture uses INDEX around UNIQUE and FILTER so each result has its own cell. Without INDEX, FILTER spills down the column, and a value already sitting in the way is #SPILL!. If no row passes and you leave out the if_empty argument, FILTER returns #CALC!.
UNIQUE and FILTER need Microsoft 365, Excel 2021, Excel 2024, or Excel for the web. Excel 2019 and earlier return #NAME?. The bookkeeping file is Excel 2010, so the dropdown that matches that file is the named range plus INDIRECT.