r/excel•
davelaws

Drop down list depending on another column

solved

I have column that I want to build a drop down for. The issue that I’m having is I want the selections that only contain certain text in another column.

So, in column A I have a list of 10 descriptions and in column B I have a list of expense categories. I need the drop down to only contain depreciation.

I’ve found lots of “cascading drop down lists” but the information in column B is not a drop down.

Posted Jan 16, 2020, 6:46 PM UTC · edited

29
Quantology56•

Where does "depreciation" come from? Can you post a screenshot of lists and what exactly you're looking for in terms of output?

2
davelawsOP•

Solution verified.

2
Clippy_Office_AsstMOD•

You have awarded 1 point to Quantology

^I ^am ^a ^bot, ^please ^contact ^the ^mods ^for ^any ^questions.

1
davelawsOP•

https://imgur.com/gallery/Ay7l8Ow

Here’s the screenshot. I want a drop down of the data in yellow but just the lines in blue that contain “Depr”

1
Quantology56•

I'm still not sure I understand. If you want the dropdowns in column G to be based on what's in column F, you need to have helper columns off to the right. Use formulas to populate cells AA5:AZ5 with possible options based on what's in column F, then have data validation in G5 refer to the list in AA5:AZ5.

If you want only some cells to have dropdowns, you'll need to use VBA.

1
davelawsOP•

I don’t think I’m being clear. On another tab I’m building a Fixed Asset Schedule. On that tab I need a drop down because I’m going to build lookups off of the descriptions in column F. So, because it’s a fixed asset schedule, I only need the descriptions in Column F in my drop down that have depreciation in Column G. The rub becomes that if the add more depreciation lines, I’d like the drop down to update automatically. Is that not possible?

1
Quantology56•

I think I understand now. You'll need three helper columns, W, Y, and Z. Column W will give each row a number if column G has "Depr" in it:

=if(iserror(search("Depr",G5)),"",max($w$4:$w4)+1)

Column Y should just have numbers from 1-50 (or whatever).

Column Z will look for 1, 2, 3 in column W. It will then pick the corresponding cell from F (or stay empty if there aren't that many entries).

=iferror(index($f:$f,match(y5,$w:$w,0),1),"")

Then the dropdown list should select from cells $Z$5:$Z$100 or however far you want to go down. It would be a good idea to make this a named range so you only have to change it once if your list expands.

1
davelawsOP•

This is perfect, thank you so much!

1
Quantology56•

Glad to help! Please reply to my original comment with "Solution verified" so this question gets marked as closed.

1